apt update 时报错
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
302 Found [IP: 91.189.91.39 80]
Err:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
302 Found [IP: 91.189.91.38 80]
Err:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
302 Found [IP: 91.189.91.39 80]
Reading package lists… Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
E: The repository ‘http://us.archive.ubuntu.com/ubuntu bionic InRelease’ is no longer signed.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic/InRelease 302 Found [IP: 91.189.91.39 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease 302 Found [IP: 91.189.91.38 80]
E: The repository ‘http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease’ is no longer signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease 302 Found [IP: 91.189.91.39 80]
E: The repository ‘http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease’ is no longer signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
cat /etc/lsb-release
可以使用命令
因为sudo只对最近的一个命令有用,所以不能用
sudo echo “” >文件名,这样sudo只对echo有用,对写入命令无效
echo "" | sudo tee /etc/apt/sources.list #清空文件内容
echo "复制的内容" | sudo tee /etc/apt/sources.list #写入