美文网首页
更新Ubuntu软件源

更新Ubuntu软件源

作者: 约德尔人winter | 来源:发表于2018-11-26 18:31 被阅读0次

问题:有时候想要下载一些软件包的时候会经历这些包的源是在国外的网站上,被墙而导致下载不下来,这个时候可以添加一些国内的源到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版本。

相关文章

网友评论

      本文标题:更新Ubuntu软件源

      本文链接:https://www.haomeiwen.com/subject/glqiqqtx.html