在国内使用ubuntu的过程中由于网络的问题可能会有些包下载速度很慢,将Ubuntu的默认的软件源修改为阿里云的就可以了明显的提高软件的下载速度了。
1.备份原来的源文件
cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.获取系统内核版本信息
lsb_release -c | grep -o “\s.*”
这里我的机器的版本为bionic
3.修改/etc/apt/sources.list
***注意将$SYS_VERSION替换为第二步中获取的版本信息。***这点非常重要,否则会失败。
deb http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $SYS_VERSION-proposed main restricted universe multiverse
4.更新
apt-get update
apt-get upgrade
评论已关闭。