“sudo apt-get update”命令在我的 ubuntu 框中給出錯誤

“sudo apt-get update”命令在我的 ubuntu 框中給出錯誤

每當我在 Ubuntu 12.04 機器上執行“sudo apt-get update”命令時,我都會收到此錯誤:

Fetched 837 B in 0s (29.0 kB/s)
Reading package lists... Done
N: Ignoring 'build' in directory '/etc/apt/sources.list.d/' as it is not a regular file
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://installsvc.vip precise Release: The following signatures were invalid: KEYEXPIRED 1468001658

W: Failed to fetch http://installsvc.vip/mirrors/apt.puppetlabs.com/dists/precise/Release

W: Some index files failed to download. They have been ignored, or old ones used instead.

我不確定問題是什麼以及如何解決?

答案1

您的/etc/apt/sources.list.d/資料夾或/etc/apt/sources.list檔案本身中有過期的儲存庫。

打開你最喜歡的控制台,我喜歡yakuakekonsole(預設是gnome-terminal我認為),然後執行

sudo grep "installsvc" -R /etc/apt/

這將告訴您“installsvc”在哪裡被引用。在該檔案中,您希望直接連結到 Puppet Labs 儲存庫。installsvc.vip/mirrors/從儲存庫 URL 中刪除部分(例如gksudo gedit /etc/apt/$fileToChangeName,手動編輯文件,記得在關閉程式之前儲存它)。

您似乎還有一個錯誤放置的文件,這不會造成任何損害,但會在apt-get輸出中「注意到」。

sudo rm /etc/apt/sources.list.d/build

會刪除它(無法恢復刪除),但您可能想要先檢查它以查看是否要保留它,mv然後chown可能會需要它。

您還應該意識到 12.04 Precise Pangolin 已經過時了。較新的 Ubuntu 將使用apt代替apt-get,但一旦解決了問題,您可以:

sudo apt-get autoclean; sudo apt-get update; sudo apt-get dist-upgrade

進行最新的可用升級,包括新新增的 Puppet Labs 儲存庫(先前的儲存庫是鏡像)中的任何升級。

相關內容