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

相关推荐
淮北4941 小时前
bash下好用的快捷键以及linux常用指令
linux·开发语言·ubuntu·bash
正点原子4 小时前
瑞芯微工业级芯加持,正点原子RK3562J开发板/核心板解锁嵌入式开发新可能!
linux·ubuntu·嵌入式
子木HAPPY阳VIP5 小时前
Ubuntu 22.04 换源+Docker安装+镜像加速
linux·ubuntu·docker
浅念-6 小时前
Linux 基础命令与核心知识点
linux·数据结构·c++·经验分享·笔记·算法·ubuntu
终端鹿6 小时前
Vue3 + TypeScript 大型项目状态管理:Pinia 类型安全最佳实践
安全·ubuntu·typescript
有毒的教程7 小时前
Ubuntu 安装完成后网络配置教程
linux·网络·ubuntu
qq_172805598 小时前
wsl ubuntu层开放22端口,主机windows层开放2222端口转发
linux·windows·ubuntu·wsl
新时代牛马8 小时前
Windows SSH 免密码登录 Ubuntu
运维·ubuntu·ssh
似水এ᭄往昔19 小时前
【Linux】自动化构建-make/Makefile
linux·运维·服务器·ubuntu
Snasph21 小时前
在Ubuntu上进行端口转发
linux·运维·ubuntu