使用阿里云的开源镜像 https://opsx.alibaba.com/mirror 找到ubuntu
在ubuntu下执行命令 sudo mv /etc/apt/sources.list /etc/apt/sources.list_backup 将 sources.list 文件备份
执行 sudo vim /etc/apt/sources.list 编辑 sources.list 文件,将文件内容清空,并粘贴刚才复制的内容,保存退出
ubuntu 18.04(bionic) 配置如下:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
执行 sudo apt-get update 更新apt软件源
注意这个可以不执行
执行 sudo apt-get dist-upgrade 升级全部软件
完毕。