我想安装 LAMP,但不知何故安装不正确。因此,为了删除以前的软件包,我使用了清除功能。大量软件包被卸载,如软件中心等。
当我重启系统时,无法登录我的桌面。出现了类似在低图形模式下运行的提示。我安装了 GNOME 桌面。然后我能够登录 GNOME 桌面,但之后我的问题就一直没有解决。
我现在无法更新,并且几个包安装时出现错误。
W: GPG error: "http://dl.google.com" stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A040830F7FAC5991
W: GPG error: "http://archive.canonical.com" precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: "http://archive.getdeb.net" precise-getdeb Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A8A515F046D7E7CF
W: GPG error: "http://in.archive.ubuntu.com" precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: "http://in.archive.ubuntu.com" precise-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: "http://in.archive.ubuntu.com" precise-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: "http://in.archive.ubuntu.com" precise-proposed Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: "http://in.archive.ubuntu.com" precise-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 437D05B5 3E5C1192
sudo apt-get update
我的查询结果cat /etc/apt/sources.list
如下:
# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release i386 (20120423)]/ precise main restricted
# See "http://help.ubuntu.com/community/UpgradeNotes" for how to upgrade to
# newer versions of the distribution.
deb "http://in.archive.ubuntu.com/ubuntu/" precise main restricted
deb-src "http://in.archive.ubuntu.com/ubuntu/" precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb "http://in.archive.ubuntu.com/ubuntu/" precise universe
deb-src "http://in.archive.ubuntu.com/ubuntu/" precise universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb "http://in.archive.ubuntu.com/ubuntu/" precise multiverse
deb-src "http://in.archive.ubuntu.com/ubuntu/" precise multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb "http://in.archive.ubuntu.com/ubuntu/" precise-security main restricted
deb-src "http://in.archive.ubuntu.com/ubuntu/" precise-security main restricted
deb "http://in.archive.ubuntu.com/ubuntu/" precise-security universe
deb-src "http://in.archive.ubuntu.com/ubuntu/" precise-security universe
deb "http://in.archive.ubuntu.com/ubuntu/" precise-security multiverse
deb-src "http://in.archive.ubuntu.com/ubuntu/" precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb-src "http://archive.canonical.com/ubuntu" precise partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb "http://extras.ubuntu.com/ubuntu" precise main
deb-src "http://extras.ubuntu.com/ubuntu" precise main
deb "http://in.archive.ubuntu.com/ubuntu/" precise-updates restricted main multiverse universe
deb "http://in.archive.ubuntu.com/ubuntu/" precise-proposed restricted main multiverse universe
deb "http://in.archive.ubuntu.com/ubuntu/" precise-backports restricted main multiverse universe
我认为我的系统的一些核心组件已被减少。
答案1
不知道您的钥匙是如何被卸载或损坏的(或者其他什么地方可能弄乱了),但把它们放回去只是一项繁重的工作。
如果以下步骤不能解决问题,您可能需要进行全新安装。
事后看来,在安装任何大型程序或升级之前备份系统总是好的,这样如果出现问题,您可以直接恢复备份,而不必配置任何内容。请查看 partimage、dump/restore 和老牌 tar。
当您添加新的软件源时,这种情况经常发生。
简单方法:首先使用 sudo apt-add-repository 添加新存储库。它将自动为您获取并安装 gpg 密钥。
或者使用 y-ppa-manager(如果存储库是 ppa)。
困难的方法:(我通常这样做;))用 Google 搜索每个“NO_PUBKEY 40976EAF437D05B5”(其中数字随着每个丢失的密钥而变化 - 并且引号有帮助)。
这样您就可以快速找到遇到过相同问题并(希望)解决了该问题的人。网页中通常会有代码,您可以将其复制并粘贴到终端中以获取和安装密钥。
使用谷歌搜索时,有时使用“搜索工具”->“任何时间”->“过去一年”来获取最新结果会有所帮助,这样您就不会得到过时的说明。
答案2
我遇到了同样的问题,只需添加密钥即可解决问题,您可以使用添加密钥
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5