Ubuntu22.04.4 - apt - 笔记

一、修改源配置

这里使用的时候又出现了联不通的情况,换成国内镜像 在update

cp /etc/apt/source.list /etc/apt/source.list.bak

vim source.list

换源地址 修改完(网上有,注意:根据Ubuntu版本不一样,部分内同也会不一样)

bash 复制代码
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

这里又遇到最后几个 update 还是连不上

根据网上资料

/etc/resolv.conf 文件 加上

复制代码
	nameserver 8.8.8.8
	nameserver 114.114.114.114

然后 apt update 就可以了

1、/etc/resolv.conf 重启被重置

嗯...... Do not edit 好家伙

1. 修改 /etc/systemd/resolved.conf 文件

Resolve

DNS=8.8.8.8 114.114.114.114

2.重启域名解析服务

systemctl restart systemd-resolved

systemctl enable systemd-resolved

3.备份当前的/etc/resolve.conf,并重新设置/run/systemd/resolve/resolv.conf 到/etc/resolve.conf的软链接

mv /etc/resolv.conf /etc/resolv.conf.bak

ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

4.查看验证

cat /etc/resolv.conf

相关推荐
我是小灰灰吖2 小时前
Ubuntu 22.04 + Qt 6.9.3 应用程序打包与部署完整指南
qt·ubuntu
自律懒人5 小时前
AI 沙箱逃逸 4 连发:GPT-5.6 黑进 Hugging Face、Kimi K3 抄答案,5 步给本地 Agent 装围栏
ubuntu
老王IT7 小时前
VMware虚拟机安装的ubuntu忘记用户密码怎么办
ubuntu
我是小灰灰吖8 小时前
Ubuntu22.04,OpenCV 4.5.5 环境搭建
linux·qt·ubuntu
集智飞行10 小时前
四种方法解决ROS2超过100个节点时的DDS瓶颈
ubuntu
数智工坊10 小时前
UECP:不确定性增强的协同感知 | 基于物理先验的BEV融合新范式
linux·ubuntu·3d·机器人
IT摆渡者1 天前
ubuntu系统网络问题
linux·运维·ubuntu
海兰1 天前
ffmpeg-wasm 完整安装指南(Ubuntu 24.04)
ubuntu·ffmpeg·wasm
海兰1 天前
云原生持续交付平台 Zadig 在 Ubuntu 24.04 上的部署及使用指南
linux·ubuntu·云原生
Anesthesia丶1 天前
PromoxVE安装笔记
笔记·ubuntu·server·promox