Ubuntu

apt update 和安裝 git 時如何消除此錯誤

  • April 1, 2021

我是 Linux 新手,我使用的是 Ubuntu 20.04.2.0 LTS。我正在嘗試通過網站中的以下步驟安裝 git。當我執行sudo apt updatesudo apt-get update返回此錯誤的命令時:

sudo apt 更新

Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease                                  
Err:3 http://tr.archive.ubuntu.com/ubuntu focal InRelease                                                                                                                                                         
 Temporary failure resolving 'tr.archive.ubuntu.com'
Err:4 http://tr.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                                                 
 Temporary failure resolving 'tr.archive.ubuntu.com'
Err:5 http://tr.archive.ubuntu.com/ubuntu focal-backports InRelease
 Temporary failure resolving 'tr.archive.ubuntu.com'
Fetched 109 kB in 36s (3.074 B/s)       
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'tr.archive.ubuntu.com'
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'tr.archive.ubuntu.com'
W: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'tr.archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

我也試過sudo apt-get update 我在https://askubuntu.com/中嘗試過這個解決方案,但是更改 DNS 並沒有解決我的問題,根據這個解決方案的第二部分,我將從我的行中刪除行,但我已經沒有這個。Temporary failure resolving 'tr.archive.ubuntu.com'``deb http:/archive.canonical.com/ natty backports``source.list

我的來源.list

來源.list

由於 ping 失敗,伺服器似乎已關閉:

ping tr.archive.ubuntu.com

最簡單的規避方法是直接使用archive.ubuntu.com,即刪除tr.前綴。

Ubuntu 存檔通常有一個本地鏡像,以減輕主伺服器上的負載並出於速度原因減少全球流量。不能說為什麼tr.-mirrors 關閉了,如果這是永久性的。通常他們應該工作。

引用自:https://unix.stackexchange.com/questions/643076