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
相关推荐
江华森4 小时前
Spring Cloud 微服务全栈实战:从 Eureka 到 Docker Compose 一文贯通
运维
江华森4 小时前
Matplotlib 数据绘图基础入门
运维
XIAOHEZIcode4 小时前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
江华森4 小时前
NumPy 数值计算基础入门
运维
唐青枫6 小时前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux
AlfredZhao2 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80
戴为沐3 天前
Linux内存扩容指南
linux
zylyehuo4 天前
Linux 彻底且安全地删除文件
linux
用户805533698034 天前
主线 U-Boot 上 RK3506:和闭源 rkbin 拔河的三个隐性契约
linux·嵌入式
用户034095297914 天前
linux fcitx 5 雾凇拼音 设置在中文输入法下仍然输入英文标点
linux