出错原因

如果遇见如下的报错

E: The repository ‘…’ does not have a Release file. N: Updating from
such a repository can’t be done securely, and is therefore disabled by
default.

可能是因为旧版的sources.list文件还在你的系统里,需要覆盖掉你的/etc/apt/sources.list。具体方法如下:


解决步骤

首先sudo -i

然后把下面的代码复制粘贴进去

cat > /etc/apt/sources.list << EOF
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu xenial-proposed restricted main universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu xenial-proposed restricted main universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
EOF

然后exit退出root

最后输入

sudo apt clean
sudo apt update
sudo apt dist-upgrade

参考链接

apt update error: The repository ‘http://us.archive.ubuntu.com/ubuntu saucy Release’ does not have a Release file

apt update error: The repository ‘http://us.archive.ubuntu.com/ubuntu saucy Release’ does not have a Release file

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐