出现错误,当我尝试 "sudo apt-get update"
Getting error, when i try "sudo apt-get update"
我现在又安装了 Ubuntu 18.04。之后,我尝试了更新和升级命令。升级命令执行得很好。但是,更新命令没有执行并给出了错误输出。您可以在以下位置查看错误:
sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 http://tr.archive.ubuntu.com/ubuntu bionic InRelease
Could not resolve 'tr.archive.ubuntu.com'
Err:3 http://tr.archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'tr.archive.ubuntu.com'
Err:4 http://tr.archive.ubuntu.com/ubuntu bionic-backports InRelease
Could not resolve 'tr.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not resolve 'tr.archive.ubuntu.com'
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Could not resolve 'tr.archive.ubuntu.com'
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Could not resolve 'tr.archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
服务器 tr.archive.ubuntu.com 目前不可用,如果您尝试在浏览器中访问它,您会收到 404 错误。您可以删除 /etc/apt/sources.list 中 archive.
前面的 tr.
,您的命令将起作用。
您可以像这样使用文本编辑器(nano 只是一个示例)来完成此操作
sudo nano /etc/apt/sources.list
或者你可以像这样使用 sed
sudo sed -i 's|http://tr.|http://|' /etc/apt/sources.list
我现在又安装了 Ubuntu 18.04。之后,我尝试了更新和升级命令。升级命令执行得很好。但是,更新命令没有执行并给出了错误输出。您可以在以下位置查看错误:
sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 http://tr.archive.ubuntu.com/ubuntu bionic InRelease
Could not resolve 'tr.archive.ubuntu.com'
Err:3 http://tr.archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'tr.archive.ubuntu.com'
Err:4 http://tr.archive.ubuntu.com/ubuntu bionic-backports InRelease
Could not resolve 'tr.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not resolve 'tr.archive.ubuntu.com'
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Could not resolve 'tr.archive.ubuntu.com'
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Could not resolve 'tr.archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
服务器 tr.archive.ubuntu.com 目前不可用,如果您尝试在浏览器中访问它,您会收到 404 错误。您可以删除 /etc/apt/sources.list 中 archive.
前面的 tr.
,您的命令将起作用。
您可以像这样使用文本编辑器(nano 只是一个示例)来完成此操作
sudo nano /etc/apt/sources.list
或者你可以像这样使用 sed
sudo sed -i 's|http://tr.|http://|' /etc/apt/sources.list