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

相关推荐
夜无霄1 小时前
安卓逆向(一)Ubuntu环境配置
linux·运维·爬虫·ubuntu
抠脚学代码13 小时前
Ubuntu Qt x64平台搭建 arm64 编译套件
数据库·qt·ubuntu
Ribou14 小时前
Ubuntu 24.04.2安装k8s 1.33.4 配置cilium
linux·ubuntu·kubernetes
Mr. Cao code15 小时前
Docker:颠覆传统虚拟化的轻量级革命
linux·运维·ubuntu·docker·容器
理智的煎蛋20 小时前
CentOS/Ubuntu安装显卡驱动与GPU压力测试
大数据·人工智能·ubuntu·centos·gpu算力
XingYuyu_Coder21 小时前
通过PXE的方式实现Ubuntu 24.04 自动安装
ubuntu·pxe
IOT-Power21 小时前
树莓派 Ubuntu 24.04 开机换源总结
linux·数据库·ubuntu
蓝纹绿茶1 天前
Python程序使用了Ffmpeg,结束程序后,文件夹中仍然生成音频、视频文件
python·ubuntu·ffmpeg·音视频
quqi991 天前
Enable FIPS in ubuntu (by quqi99)
linux·运维·ubuntu
人工智能训练师1 天前
在Ubuntu中如何使用PM2来运行一个编译好的Vue项目
linux·运维·服务器·vue.js·ubuntu·容器