解决Ubuntu下载缓慢问题

目录

1、备份原来的源文件

2. 新建一个sources.list文件

3. 更新apt软件源

4、修改损坏的依赖包,卸载出错的包,重新下载新的正确的版本

5、更新

6、效果


 

Ubuntu 系统自带的源文件,都是国外的源网址,在国内下载安装升级源或者依赖的时候,都比较慢,更换国内的源地址,轻松搞定此问题。

1、备份原来的源文件

sudo mv /etc/apt/sources.list sources.list_backup

2. 新建一个sources.list文件

sudo vim /etc/apt/sources.list

        输入如下内容并保存退出

deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse

3. 更新apt软件源

sudo apt-get update

4、修改损坏的依赖包,卸载出错的包,重新下载新的正确的版本

sudo apt-get -f install

5、更新

 sudo apt-get upgrade

6、效果

以前:

 现在:

猜你喜欢

转载自blog.csdn.net/weixin_46504244/article/details/121116418