当使用 sudo apt-get update 更新源的过程中出现错误时,可以选择如下的两种方式进行修改。
方式1:
修改/etc/apt/sources.list文件
sudo gedit /etc/apt/sources.list
打开后删除其中的所有内容,然后选择各大国内的源即可,下面我提供了阿里源的Ubuntu18.04的文件。
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe
修改完成后,再次执行更新指令看是否会报错,如若报错这查看方式2的方法,没有则不管。
sudo apt-get update
方式2:
所有程序-->打开“软件和更新” --> "其他软件" -->点击不能用软件源,然后将其删除即可
再次执行更新指令
sudo apt-get update
至此,sudo apt-get update 更新源问题错误已解决。
参考博客: