当前位置: 代码网 > 服务器>服务器>Linux > Ubuntu操作系统更换国内源过程

Ubuntu操作系统更换国内源过程

2026年03月05日 Linux 我要评论
ubuntu更换国内源操作步骤1. 对先前内容进行备份// 备份源内容 (需要管理员权限)> sudo cp /etc/apt/sources.list /etc/apt/sources.lis

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

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2026  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com