在Ubuntu版本中如何更改下载源
1.查看系统版本号(官⽅语⾔系统代码)
lsb_release -c
得到本系统的系统代码
类似其他版本的
Ubuntu 12.04 (LTS)代号为precise。
Ubuntu 14.04 (LTS)代号为trusty。
Ubuntu 15.04 代号为vivid。
Ubuntu 15.10 代号为wily。
Ubuntu 16.04 (LTS)代号为xenial
这是⼀个阿⾥的是我的系统就应该要将上⾯的trusty改为bionic
2.⾸先到配置⽂件,将系统配置⽂件备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
3.打开⽂件
使⽤vim和geidt都⾏
  vi /etc/apt/sources.list
  sudo gedit /etc/apt/sources.list
⼆者选其⼀
4.注释或者删除⾥⾯的⽂件内容(我⾃⼰选择的是删除⽐较快)然后将下⾯的这些复制进去保存⼀般我们选择下⾯的阿⾥源:
deb mirrors.aliyun/ubuntu/ bionic main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ bionic main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ bionic-security main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ bionic-security main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ bionic-updates main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ bionic-updates main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ bionic-backports main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ bionic-backports main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ bionic-proposed main restricted universe multiverse
 下⾯还有其他官⽅源⾃⾏试验
官⽅源:
deb archive.ubuntu/ubuntu/ trusty main restricted universe multiverse
ubuntu vim命令deb archive.ubuntu/ubuntu/ trusty-security main restricted universe multiverse
deb archive.ubuntu/ubuntu/ trusty-updates main restricted universe multiverse
deb-src archive.ubuntu/ubuntu/ trusty-security main restricted universe multiverse deb-src archive.ubuntu/ubuntu/ trusty-updates main restricted universe multiverse deb-src archive.ubuntu/ubuntu/ trusty-proposed main restricted universe multiverse deb-src archive.ubuntu/ubuntu/ trusty-backports main restricted universe multiverse deb mirrors.163/ubuntu/ trusty main restricted universe multiverse
163源:
deb mirrors.163/ubuntu/ trusty-security main restricted universe multiverse
deb mirrors.163/ubuntu/ trusty-updates main restricted universe multiverse
deb mirrors.163/ubuntu/ trusty-proposed main restricted universe multiverse
deb mirrors.163/ubuntu/ trusty-backports main restricted universe multiverse
deb-src mirrors.163/ubuntu/ trusty main restricted universe multiverse
deb-src mirrors.163/ubuntu/ trusty-security main restricted universe multiverse deb-src mirrors.163/ubuntu/ trusty-updates main restricted universe multiverse deb-src mirrors.163/ubuntu/ trusty-proposed main restricted universe multiverse deb-src mirrors.163/ubuntu/ trusty-backports main restricted universe multiverse
阿⾥源:
deb mirrors.aliyun/ubuntu/ trusty main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ trusty-security main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ trusty-updates main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ trusty-proposed main restricted universe multiverse
deb mirrors.aliyun/ubuntu/ trusty-backports main restricted universe multiverse deb-src mirrors.aliyun/ubuntu/ trusty main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ trusty-security main restricted universe multiverse deb-src mirrors.aliyun/ubuntu/ trusty-updates main restricted universe multiverse deb-src mirro
rs.aliyun/ubuntu/ trusty-proposed main restricted universe multiverse deb-src mirrors.aliyun/ubuntu/ trusty-backports main restricted universe multiverse centos源(放⼼使⽤):
deb centos.bitcomm/ubuntu trusty main restricted universe multiverse
deb centos.bitcomm/ubuntu trusty-security main restricted universe multiverse
deb centos.bitcomm/ubuntu trusty-updates main restricted universe multiverse
deb centos.bitcomm/ubuntu trusty-backports main restricted universe multiverse deb centos.bitcomm/ubuntu trusty-proposed main restricted universe multiverse
deb-src centos.bitcomm/ubuntu trusty main restricted universe multiverse
deb-src centos.bitcomm/ubuntu trusty-security main restricted universe multiverse deb-src centos.bitcomm/ubuntu trusty-updates main restricted universe multiverse deb-src centos.bitcomm/ubuntu trusty-backports main restricted universe multiverse deb-src centos.bitcomm/ubuntu trusty-proposed main restricted universe multiverse 搜狐源:
deb mirrors.sohu/ubuntu/ trusty main restricted universe multiverse
deb mirrors.sohu/ubuntu/ trusty-backports main restricted universe multiverse deb-src mirrors.sohu/ubuntu/ trusty main restricted universe multiverse
deb-src mirrors.sohu/ubuntu/ trusty-security main restricted universe multiverse deb-src mirrors.sohu/ubuntu/ trusty-updates main restricted universe multiverse deb-src mirrors.sohu/ubuntu/ trusty-proposed main restricted universe multiverse deb-src mirrors.sohu/ubuntu/ trusty-backports main restricted universe multiverse   
4.保存退出
如果⽤gedit打开就直接点击上⾯的保存
如果⽤vim打开就⽤ ESC :wq
5.更新源
sudo apt-get update
6.更新软件
sudo apt-get dist-upgrade
sudo apte-get upgrade

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。