Ubuntu修改apt-get源为国内镜像源的⽅法1、原⽂件备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2、编辑源列表⽂件
sudo vim /etc/apt/sources.list
3、将原来的列表删除,添加如下内容(阿⾥镜像源)
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 multivers
deb mirrors.aliyun/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src mirrors.aliyun/ubuntu/ bionic-proposed main restricted universe multiverse
4、运⾏ sudo apt-get update
ubuntu vim命令5、如果出现以下错误:
E: ⽆法获得锁 /var/lib/apt/lists/lock - open (11: 资源暂时不可⽤)
E: ⽆法对⽬录 /var/lib/apt/lists/ 加锁
是因为上⼀次更新源的时候⾮常规中断导致的,解决⽅法如下:
sudo rm /var/lib/apt/lists/lock

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