ubuntu又双叕更新啦!安装好ubuntu双系统或者ubuntu虚拟机之后,默认的软件更新源是国外的,在国内使用速度很慢,用"apt install"安装软件时各种网络问题层出不穷,因此我们需要更换成国内的源,这样才能正常安装和更新软件。

首先将我们的原来的软件源另存起来备份:

sudo cp -v /etc/apt/sources.list /etc/apt/sources.list.backup

终端执行chmod命令更改文件权限使软件源文件可编辑:

sudo chmod 777 /etc/apt/sources.list

之后通过gedit命令编辑软件源:

sudo gedit /etc/apt/sources.list

然后将下面任意一个源复制进去保存就好了:

阿里云源:

deb http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse

清华源:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse

修改完软件源后,更新软件列表和软件:

sudo apt update

sudo apt upgrade

注意:“eoan”为ubuntu版本名!“eoan”代表ubuntu19.10,“xenial”代表ubuntu16.04,“bionic”代表ubuntu18.04,“disco”代表ubuntu19.04,如果自己的版本不再所描述的上面,可以通过查看,并更改相应位置就ok了!

lsb_release -c

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐