想使用apt命令来安装一些软件,可以报“E:无法定位软件包”
排除网络未连接的问题,那就是网络质量的问题!!!
究其原因, ubuntu,我们在使用apt新装软件的时候,会使用官方的网站去下载软件,但是会因为国内的转接点太多,而导致下载的速度非常慢 ,我们可以通过换成一些中间的节点来进行下载,比如阿里源,中科大源,清华源等等,这样的网站,他们会定时和官方的源进行同步和更新,而我们直接同步他们,速度就会比直接同步官方的源快很多,这样能够大大增加我们的下载软件的速度。
更换apt源:(先备份一下)
cd /etc/apt/
sudo cp sources.list sources.list.bb
sudo vi sources.list
删除其中所有的内容,替换成国内的源内容,我推荐阿里源
阿里云Ubuntu 18.04源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
然后执行
sudo apt update
sudo apt upgrade
亲测有效!下载果然不会报错,而且网速更快了!
转载自:https://www.jianshu.com/p/16502ed02e29
转载自:https://www.cnblogs.com/dtiove/p/5917263.html
学习交流