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

相关推荐
匆匆那年9679 小时前
llamafactory推理消除模型的随机性
linux·服务器·学习·ubuntu
wypywyp17 小时前
8. ubuntu 虚拟机 linux 服务器 TCP/IP 概念辨析
linux·服务器·ubuntu
阿蒙Amon17 小时前
TypeScript学习-第10章:模块与命名空间
学习·ubuntu·typescript
No8g攻城狮18 小时前
【Linux】Windows11 安装 WSL2 并运行 Ubuntu 22.04 详细操作步骤
linux·运维·ubuntu
森G21 小时前
七、04ledc-sdk--------makefile有变化
linux·c语言·arm开发·c++·ubuntu
生活很暖很治愈1 天前
Linux——孤儿进程&进程调度&大O(1)调度
linux·服务器·ubuntu
getapi1 天前
注塑件的费用构成
linux·服务器·ubuntu
lucky-billy1 天前
Ubuntu 下一键部署 ROS2
linux·ubuntu·ros2
阿梦Anmory1 天前
Ubuntu配置代理最详细教程
linux·运维·ubuntu
getapi1 天前
Ubuntu 22.04 服务器的系统架构是否为 amd64 x86_64
linux·服务器·ubuntu