apt-get 更新,https 來源已損壞

apt-get 更新,https 來源已損壞

當我嘗試運行時apt-get update出現以下錯誤:

$ sudo apt-get update
/usr/lib/apt/methods/https: error while loading shared libraries: libnett▒d.sm.4: cannot open shared object file: No such file or directory
E: Method https has died unexpectedly!
E: Sub-process https returned an error code (127)
E: Method /usr/lib/apt/methods/https did not start correctly

當我停用所有 HTTPS 來源(docker、gitlab-runner)時,apt-get 運作正常並且我能夠安裝軟體包。 Google 未能找到名為 的程式庫libnett*d.sm.4

我在 RaspberryPi 3 上運行 raspbian:

$ cat /etc/*release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

我嘗試過重新安裝apt-transport-https

我還注意到:ping6效果不佳(同一個庫)。當然,我已經嘗試過停用 IPv6。

更新:

$ cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

$ cat /etc/apt/sources.list.d/*
deb [arch=armhf] https://apt.dockerproject.org/repo raspbian-jessie main


deb http://archive.raspberrypi.org/debian/ jessie main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
# deb-src http://archive.raspberrypi.org/debian/ jessie main ui


# this file was generated by packages.gitlab.com for
# the repository at https://packages.gitlab.com/runner/gitlab-ci-multi-runner
# deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/raspbian/ jessie main
# deb-src https://packages.gitlab.com/runner/gitlab-ci-multi-runner/raspbian/ jessie main

我完全禁用了來源gitlab-runnerdocker在輸出中處於活動狀態 - 如果也註釋該行,則apt-get update運行良好全部主動來源使用http

答案1

這看起來像是磁碟損壞;應該是在尋找libnettle.so.4

要解決這個特定問題,我懷疑您應該重新安裝libcurl3-gnutls

apt-get --reinstall install libcurl3-gnutls

(作為root)。

但這可能不是罪魁禍首;若要識別其他損壞的檔案(至少是從軟體包安裝的檔案),您可以使用debsums

debsums -c

(如有必要,安裝後使用apt-get install debsums)。您應該重新安裝由 標記的任何軟體包debsums -c

線上debsums說明頁面提供了這個方便的命令來重新安裝受影響的軟體包:

apt-get install --reinstall $(dpkg -S $(debsums -c) | cut -d : -f 1 | sort -u)

相關內容