Ubuntu apt更换为阿里源

ゞ 浴缸里的玫瑰 2022-03-22 13:52 621阅读 0赞

apt源配置在 /etc/apt/sources.list ,首先备份一下:

  1. cd /etc/apt/
  2. cp sources.list sources.list.bak

然后修改sources.list为:

  1. deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
  2. deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
  4. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
  6. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
  7. deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
  8. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
  9. deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
  10. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse

注意:上面的内容中xenial 是我的ubuntu的版本号,你要替换成你的版本号。查看版本号方法为:

  1. lsb_release -c

如:
在这里插入图片描述

最后更新一下软件列表

  1. sudo apt-get update

发表评论

表情:
评论列表 (有 0 条评论,621人围观)

还没有评论,来说两句吧...

相关阅读