ubuntu20.04如何更换国内源

[复制链接]
发表于 2023-6-24 12:50:53 | 显示全部楼层 |阅读模式
ubuntu20.04更换国内源的方法。以下更换为阿里云。如果是自己安装的Ubuntu,在安装设置时就可以直接更换为阿里云“https://mirrors.aliyun.com/ubuntu/”直接更换这个地址就可以了
illustration_1_6046f9d6e23d31502.jpg
1.打开终端。

2.输入以下命令备份原来的源。
  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
复制代码
3.再输入以下命令打开sources.list配置文件更换源。
  1. sudo vim/etc/apt/sources.list

  2. //配置内容如下

  3. deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

  4. deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

  5. deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

  6. deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

  7. deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

  8. deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

  9. deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

  10. deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

  11. deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

  12. deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse focal
复制代码
4.再输入命令更新源。
  1. sudo apt-get update
复制代码
5.最后输入命令更新一下软件即可。
  1. sudo apt-get upgrade
复制代码
大功告成。

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号
Archiver|手机版|小黑屋|爬行的蜗牛

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|蒙ICP备2023005932号-1

在本版发帖
关注公众号
QQ客服返回顶部