我的任务是在我们的 Ubuntu 服务器上安装隐私保护身份管理 Shibboleth。为了完成设置,我需要清除服务提供商包 (libapache2-mod-shib2) 的旧标准安装,并安装由“SWITCH”身份验证和授权基础设施提供的新安装 (https://www.switch.ch/aai/guides/sp/installation/?os=ubuntu)。
如果我尝试安装新软件包,我会收到以下错误:
service@emdlw:~$ sudo apt-get install shibboleth
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
shibboleth : Depends: shibboleth-sp2-utils (>= 2.6.0)
Recommends: libapache2-mod-shib2 (>= 2.6.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
经过一番研究,我遵循了以下解决方案添加 PPA 后如何解决未满足的依赖关系?但都无法解决我的问题。
我猜测 apt packetmanager 坏了,因为包“shibboleth-sp2-utils”似乎仍然安装着,但无法删除或更新以解决依赖错误:
service@emdlw:~$ sudo apt-get install shibboleth-sp2-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
shibboleth-sp2-utils : Depends: libshibsp-plugins (= 2.6.0+dfsg1-3switchaai2~trusty1) but it is not going to be installed
Depends: libsystemd-daemon0 (>= 31) but it is not installable
E: Unable to correct problems, you have held broken packages.
输出 cat /etc/apt/sources.list:
service@emdlw:~$ cat /etc/apt/sources.list
#
# deb cdrom:[Ubuntu-Server 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.3)]/ xenial main restricted
# deb cdrom:[Ubuntu-Server 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.3)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## 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
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://de.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial universe
deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates 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://de.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates 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://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe 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 http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
输出 cat /etc/apt/sources.list.d/*:
service@emdlw:~$ cat /etc/apt/sources.list.d/*
deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial main
deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial main
deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial main
deb http://pkg.switch.ch/switchaai/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
# deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
有人能给出如何修复这个问题的建议吗?任何帮助我都会很感激。
- 埃里克
答案1
sudo apt-get--purge 自动删除
删除孤立包,即以前作为依赖项安装但现在不再作为依赖项安装的已安装包。在删除安装了您不再感兴趣的依赖项的包后使用此功能。
答案2
上述答案对我来说没有任何改变。有用的是sudo dpkg --purge <package>
。这也适用于损坏的包裹未安装例如
pB libnspr4-0d
注意:dpkg 发出了警告,但是损坏的包从列表中消失了(如果出现另一个,则重复此操作直到完成)。