出错原因

如果遇见如下的报错

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

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐