Ubuntu操作系统更换国内源过程
更新时间:2026年03月04日 16:50:50 作者:也言
文章介绍了如何将Ubuntu系统的软件源更换为国内的阿里源,包括备份原源列表、添加阿里源地址和公钥、以及更新源和软件版本的详细步骤
Ubuntu更换国内源
操作步骤
1. 对先前内容进行备份
// 备份源内容 (需要管理员权限) > sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 更换国内源文
2.1 更换阿里源
// 阿里源 > echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list

2.2 添加阿里公钥
// 添加公钥Key > sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32

3. 更新源及软件版本
> sudo apt update -y > sudo apt upgrade -y

总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
Ubuntu20.04没有wifi的解决方案(Realtek版本)
本文介绍了如何在Ubuntu下手动安装无线网卡驱动,避免了需要在Windows下查看网卡型号的麻烦,通过终端命令查看网卡型号,使用git下载驱动文件并将其放置在/lib/firmware/rtw89目录下,然后激活相应内核,最后重启系统以解决没有WiFi的问题2026-03-03
Linux中Docker遇到报port is already allocated错误
在Linux系统中,如果尝试绑定一个网络服务到一个已经被其他进程使用的端口上,你会遇到“port is already allocated”错误,这意味着该端口已经被另一个进程占用,因此无法再次被分配给任何新的服务2024-06-06


最新评论