ubuntu 16.04一键换源

清华源

bash 复制代码
# 1. 备份现有源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

# 2. 写入清华源(适配你的 Ubuntu 16.04 xenial)
sudo tee /etc/apt/sources.list <<-'EOF'
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
EOF

# 3. 更新
sudo apt update

腾讯

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
sudo tee /etc/apt/sources.list <<-'EOF'
deb http://mirrors.tencentyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.tencentyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.tencentyun.com/ubuntu/ xenial-security main restricted universe multiverse
EOF
sudo apt update

华为

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
sudo tee /etc/apt/sources.list <<-'EOF'
deb http://repo.huaweicloud.com/ubuntu/ xenial main restricted universe multiverse
deb http://repo.huaweicloud.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://repo.huaweicloud.com/ubuntu/ xenial-security main restricted universe multiverse
EOF
sudo apt update

阿里

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
sudo tee /etc/apt/sources.list <<-'EOF'
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
EOF
sudo apt update
相关推荐
天天喝旺仔8 分钟前
Linux 性能排查实战:用 perf、strace 与火焰图定位 CPU、内存与 IO 瓶颈
linux·性能优化·运维开发
LuminousCPP13 分钟前
Linux系统编程(二):从目录树到命令执行|路径、环境变量、alias 与文件操作入门
linux·经验分享·笔记
第十人i16 分钟前
Linux 系统初始化配置清单:新服务器快速部署
linux·服务器
LongRunning18 分钟前
【Linux】RK3568-OpenCV+YOLO(七)
linux
j7~26 分钟前
【Linux】三十八.C++ 手写 HTTP 服务器:裸 socket + fork 多进程,从 HTTP 报文解析到浏览器打开网页
linux·网络·网络协议·学习·http·网络编程
傲世仙尊1 小时前
设计者的取舍-路径fork的诞生与全局文件队列
linux
蓝速科技1 小时前
会议室门牌签到功能选型与落地指南丨蓝速科技
大数据·运维·数据库·人工智能·科技
逐流人1 小时前
Containerd容器管理实战:从架构原理到nerdctlcrictl工具链
linux·运维·云原生·容器·云计算·containerd
Tairitsu_H1 小时前
[Linux] 编辑器vim、编译器和动静态链接
linux·vim·gcc·g++·动态链接·静态链接
lzx_0021 小时前
Linux指令(一) 简单了解部分指令
linux