更新Ubuntu软件源

2018-11-26  本文已影响0人  约德尔人winter

问题:有时候想要下载一些软件包的时候会经历这些包的源是在国外的网站上,被墙而导致下载不下来,这个时候可以添加一些国内的源到ubuntu系统中。

解决方案:在Ubuntu软件和更新中可以看到,分为Ubuntu软件和其他软件。我们平时下载需要的包基本上是在其他软件中。可以改变其他软件的源来添加一下包。

sudo gedit /etc/apt/sources.list
将一些国内的源添加进去。比如阿里源:


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-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports 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

然后执行
sudo apt-get update 更新源。
就可以在这些源中下载一些我们需要的文件。
比如想要下载gcc5.3的版本,可以执行:
apt-cache madison gcc查看这些源中拥有的gcc版本。

上一篇 下一篇

猜你喜欢

热点阅读