我正在尝试升级和修补 CVE 2016-2017,在此过程中,我收到了有关依赖项的错误。我尝试解决这些问题,但我有点新手,当我尝试修复依赖项问题时,我得到了额外的依赖项。我正尝试根据我读过的几本指南来做到这一点。
如果我跑
sudo apt-get install --only-upgrade libssl1.0.0 openssl
我明白了
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
grub-pc : Depends: grub2-common (= 1.99-21ubuntu3.18)
Depends: grub-pc-bin (= 1.99-21ubuntu3.18)
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我希望有人能帮助我解决这个问题。
谢谢!
更新 1- 我运行了 apt-get -f install 并收到以下内容
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
libjson-c2
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
grub-pc
The following packages will be upgraded:
grub-pc
1 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.
1 not fully installed or removed.
Need to get 0 B/140 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of grub-pc:
grub-pc depends on grub2-common (= 1.99-21ubuntu3.18); however:
Version of grub2-common on system is 1.99-21ubuntu3.20.
grub-pc depends on grub-pc-bin (= 1.99-21ubuntu3.18); however:
Version of grub-pc-bin on system is 1.99-21ubuntu3.20.
dpkg: error processing grub-pc (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
更新2我也跑过sudo apt-get 更新
Hit http://mirror.rackspace.com precise Release.gpg
Hit http://mirror.rackspace.com precise-updates Release.gpg
Hit http://mirror.rackspace.com precise-backports Release.gpg
Hit http://mirror.rackspace.com precise-security Release.gpg
Hit http://mirror.rackspace.com precise Release
Hit http://mirror.rackspace.com precise-updates Release
Hit http://mirror.rackspace.com precise-backports Release
Hit http://mirror.rackspace.com precise-security Release
Hit http://mirror.rackspace.com precise/main Sources
Hit http://mirror.rackspace.com precise/restricted Sources
Hit http://mirror.rackspace.com precise/universe Sources
Get:1 http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring Release.gpg [490 B]
Hit http://mirror.rackspace.com precise/multiverse Sources
Hit http://mirror.rackspace.com precise/main amd64 Packages
Hit http://mirror.rackspace.com precise/restricted amd64 Packages
Hit http://mirror.rackspace.com precise/universe amd64 Packages
Hit http://mirror.rackspace.com precise/multiverse amd64 Packages
Hit http://mirror.rackspace.com precise/main i386 Packages
Hit http://mirror.rackspace.com precise/restricted i386 Packages
Hit http://mirror.rackspace.com precise/universe i386 Packages
Hit http://mirror.rackspace.com precise/multiverse i386 Packages
Hit http://mirror.rackspace.com precise/main TranslationIndex
Hit http://mirror.rackspace.com precise/multiverse TranslationIndex
Hit http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring Release
Hit http://mirror.rackspace.com precise/restricted TranslationIndex
Ign http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring Release
Hit http://mirror.rackspace.com precise/universe TranslationIndex
Hit http://mirror.rackspace.com precise-updates/main Sources
Hit http://mirror.rackspace.com precise-updates/restricted Sources
Hit http://mirror.rackspace.com precise-updates/universe Sources
Hit http://mirror.rackspace.com precise-updates/multiverse Sources
Hit http://mirror.rackspace.com precise-updates/main amd64 Packages
Hit http://mirror.rackspace.com precise-updates/restricted amd64 Packages
Hit http://mirror.rackspace.com precise-updates/universe amd64 Packages
Hit http://mirror.rackspace.com precise-updates/multiverse amd64 Packages
Hit http://mirror.rackspace.com precise-updates/main i386 Packages
Hit http://mirror.rackspace.com precise-updates/restricted i386 Packages
Hit http://mirror.rackspace.com precise-updates/universe i386 Packages
Hit http://mirror.rackspace.com precise-updates/multiverse i386 Packages
Hit http://mirror.rackspace.com precise-updates/main TranslationIndex
Hit http://mirror.rackspace.com precise-updates/multiverse TranslationIndex
Hit http://archive.canonical.com precise Release.gpg
Ign http://ppa.launchpad.net precise Release.gpg
Get:2 http://security.ubuntu.com precise-security Release.gpg [198 B]
Hit http://mirror.rackspace.com precise-updates/restricted TranslationIndex
Hit http://archive.ubuntu.com precise Release.gpg
Hit http://mirror.rackspace.com precise-updates/universe TranslationIndex
Hit http://mirror.rackspace.com precise-backports/main Sources
Hit http://mirror.rackspace.com precise-backports/restricted Sources
Hit http://mirror.rackspace.com precise-backports/universe Sources
Hit http://mirror.rackspace.com precise-backports/multiverse Sources
Hit http://mirror.rackspace.com precise-backports/main amd64 Packages
Ign http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main amd64 Packages/DiffIndex
Hit http://mirror.rackspace.com precise-backports/restricted amd64 Packages
Hit http://mirror.rackspace.com precise-backports/universe amd64 Packages
Hit http://mirror.rackspace.com precise-backports/multiverse amd64 Packages
Hit http://mirror.rackspace.com precise-backports/main i386 Packages
Hit http://mirror.rackspace.com precise-backports/restricted i386 Packages
Hit http://mirror.rackspace.com precise-backports/universe i386 Packages
Hit http://mirror.rackspace.com precise-backports/multiverse i386 Packages
Hit http://mirror.rackspace.com precise-backports/main TranslationIndex
Ign http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main i386 Packages/DiffIndex
Hit http://mirror.rackspace.com precise-backports/multiverse TranslationIndex
Hit http://mirror.rackspace.com precise-backports/restricted TranslationIndex
Hit http://mirror.rackspace.com precise-backports/universe TranslationIndex
Hit http://mirror.rackspace.com precise-security/main Sources
Hit http://archive.canonical.com precise Release
Hit http://mirror.rackspace.com precise-security/restricted Sources
Ign http://ppa.launchpad.net precise Release
Get:3 http://security.ubuntu.com precise-security Release [55.5 kB]
Get:4 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Hit http://mirror.rackspace.com precise-security/universe Sources
Hit http://mirror.rackspace.com precise-security/multiverse Sources
Hit http://mirror.rackspace.com precise-security/main amd64 Packages
Hit http://mirror.rackspace.com precise-security/restricted amd64 Packages
Ign http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main TranslationIndex
Hit http://mirror.rackspace.com precise-security/universe amd64 Packages
Hit http://mirror.rackspace.com precise-security/multiverse amd64 Packages
Hit http://mirror.rackspace.com precise-security/main i386 Packages
Hit http://mirror.rackspace.com precise-security/restricted i386 Packages
Hit http://mirror.rackspace.com precise-security/universe i386 Packages
Hit http://mirror.rackspace.com precise-security/multiverse i386 Packages
Hit http://mirror.rackspace.com precise-security/main TranslationIndex
Hit http://mirror.rackspace.com precise-security/multiverse TranslationIndex
Hit http://mirror.rackspace.com precise-security/restricted TranslationIndex
Hit http://mirror.rackspace.com precise-security/universe TranslationIndex
Hit http://mirror.rackspace.com precise/main Translation-en
Hit http://mirror.rackspace.com precise/multiverse Translation-en
Hit http://mirror.rackspace.com precise/restricted Translation-en
Hit http://mirror.rackspace.com precise/universe Translation-en
Hit http://mirror.rackspace.com precise-updates/main Translation-en
Hit http://mirror.rackspace.com precise-updates/multiverse Translation-en
Hit http://mirror.rackspace.com precise-updates/restricted Translation-en
Hit http://mirror.rackspace.com precise-updates/universe Translation-en
Hit http://mirror.rackspace.com precise-backports/main Translation-en
Hit http://archive.canonical.com precise/partner amd64 Packages
Hit http://archive.ubuntu.com precise Release
Hit http://mirror.rackspace.com precise-backports/multiverse Translation-en
Hit http://mirror.rackspace.com precise-backports/restricted Translation-en
Hit http://mirror.rackspace.com precise-backports/universe Translation-en
Hit http://mirror.rackspace.com precise-security/main Translation-en
Hit http://mirror.rackspace.com precise-security/multiverse Translation-en
Hit http://mirror.rackspace.com precise-security/restricted Translation-en
Hit http://mirror.rackspace.com precise-security/universe Translation-en
Hit http://archive.canonical.com precise/partner i386 Packages
Get:5 http://archive.ubuntu.com precise-updates Release [55.4 kB]
Hit http://archive.canonical.com precise/partner TranslationIndex
Get:6 http://security.ubuntu.com precise-security/multiverse amd64 Packages [3,363 B]
Ign http://ppa.launchpad.net precise/main TranslationIndex
Hit http://archive.canonical.com precise/partner Translation-en
Get:7 http://security.ubuntu.com precise-security/multiverse i386 Packages [3,542 B]
Hit http://archive.ubuntu.com precise/multiverse amd64 Packages
Hit http://security.ubuntu.com precise-security/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise/multiverse i386 Packages
Hit http://security.ubuntu.com precise-security/multiverse Translation-en
Hit http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main amd64 Packages
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main i386 Packages
Get:8 http://archive.ubuntu.com precise-updates/multiverse amd64 Packages [17.1 kB]
Ign http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main Translation-en_US
Ign http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring/main Translation-en
Get:9 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [17.3 kB]
Hit http://archive.ubuntu.com precise-updates/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise/multiverse Translation-en
Hit http://archive.ubuntu.com precise-updates/multiverse Translation-en
Err http://ppa.launchpad.net precise/main Sources
404 Not Found
Err http://ppa.launchpad.net precise/main amd64 Packages
404 Not Found
Err http://ppa.launchpad.net precise/main i386 Packages
404 Not Found
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Fetched 153 kB in 4s (36.0 kB/s)
W: GPG error: http://stable.packages.cloudmonitoring.rackspace.com cloudmonitoring Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A086F077D05AB914
W: Failed to fetch http://ppa.launchpad.net/ondrej/php5/ubuntu/dists/precise/main/source/Sources 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/ondrej/php5/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/ondrej/php5/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
最后更新
在@db429 的帮助下,我找到了问题的根源。我有一些需要删除的坏 PPA。删除后,我必须删除 grub-pc,然后更新,然后重新安装 grub。
到那时,我就能让一切按预期进行。
答案1
好的,你继承了一个相当不错的建筑工地。
到目前为止,我们有 4 个问题需要解决:未满足的 grub 依赖项、sources.list 中不存在的 ppa、rackspace 存储库缺少 gpg-key 以及 100 个等待的更新。
- 首先。运行时出现 404
sudo apt-get update
是因为该存储库不再存在。您可以找到有关存储库的更多信息这里。因此,我们必须在源列表中将其注释掉。打开相应的文件sudo nano /etc/apt/sources.list
- 您也可以使用 vim。找到以 开头的三行http://ppa.launchpad.net/ondrej/php5/...
并在其前面添加#
- 保存文件。也许它是 /etc/apt/sources.list.d/ 中的一个文件 - 不确定,4 年前我用过 12.04 - 程序保持不变。 - 现在让我们添加同一个程序员的当前 ppa
sudo add-apt-repository ppa:ondrej/php
(如果你的系统运行的是 php5.4,请使用sudo add-apt-repository ppa:ondrej/php5-oldstable
- 参见这里)。这将在添加 gpg-key 和存储库后更新存储库 - 如果出现W: GPG error:
让我们暂时忽略它。 - 在升级其他 100 个之前,我们首先必须解决 grub 问题 - 因此我们将卸载
sudo apt-get remove grub-common
并重新安装它们sudo apt-get install grub-pc
- 包的差异是由于依赖关系造成的;所有 grub 包都依赖于 grub-common,而 grub-pc 将它们全部拉回来。 如果到目前为止我们没有遇到任何新问题,让我们去更新所有这 100 个软件包。让我们开始使用
sudo apt-get dist-upgrade
,我们使用 dist-upgrade 而不是 upgrade,因为它更聪明 ;) - 参见这里。可能需要重复此操作几次。对于 pgp-keyhttp://stable.packages.cloudmonitoring.rackspace.com存储库最好联系他们,因为我在标准密钥服务器上的任何地方都找不到他们的密钥。可以找到让您的系统识别密钥的过程这里——直到那时才有
sudo apt-get upgrade --allow-unauthenticated
可能解决这个最后的堡垒。