概述
记录一下自己遇见的一些小问题:
昨天在Ubuntu上想要安装一下vim和htop以及pstree但是发现输入命令后,都会显示没有可用的软件包,上网一顿搜以后,网上说只要update一下就可以了,因为Ubuntu的默认源是国外的,所以更新的特别慢,花了三个小时,满心期待……最后更新包报了一大堆错。
大概就是报了一些这样的错:
W: 无法下载 http://archive.scrapy.org/ubuntu/dists/scrapy/InRelease
无法解析域名“archive.scrapy.org”(网络不可达)
W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
然后明白因为源是国外的,所以有些网站好像是要翻墙的,这不仅造成更新特别慢的问题,也造成更新不成功的问题。然后想去换源,我换的是阿里云的源,换源之后你会发现更新软件什么的真的快了很多,原本更新源就花了三个多小时,换完之后就花了四十多分钟就把源和软件包全部更新完了。下面是换源的操作:
1,先进入root模式:
sudo -s
2,输入你的密码
3,进入源的目录:
cd /etc/apt
4,在换源之前最好备份一下自己的源(避免遇到问题的时候弄不回去)备份的代码:
cp sources.list sources.list.bak
5,这时候可以输入一下命令去修改源:
sudo gedit sources.list
这时候会进入<sources.list>的页面把原来的源删去然后改成你要的源就可以了,更改后点击保存。
6,这个时候就可以更新源啦:
sudo apt update
7,顺便把软件也更新一下:
sudo apt upgrade
这时候安装vim以及其他的就不会出错啦!
安装vim:
sudo apt install vim
安装pstree:
sudo apt install saidar
安装htop:
sudo apt install htop
下面是上网搜集的一些常用的源:
阿里云源:
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
中科大源:
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
清华大学源:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
163源:
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
最后
以上就是安静小甜瓜为你收集整理的有关Ubuntu18.04的换源问题的全部内容,希望文章能够帮你解决有关Ubuntu18.04的换源问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复