The following packages have been kept back: click click-dev gir1.2-click-0.4 libclick-0.4-0 0
但
很明显,所有这些包要么被搁置在某个地方,要么处于某种冲突中,要么会导致冲突。我不明白为什么或在哪里。它们既不被锁定在突触中,也不被apt
或 所阻碍aptitude
。
我很好奇为什么这些包裹被扣留?我无法通过apt-get dist-upgrade
或 来克服这个问题apt-get --with-new-pkgs upgrade
。
我使用的是 Linux Mint 17.3。
apt-cache policy click click-dev gir1.2-click-0.4 libclick-0.4-0
:
click:
Installed: 0.4.42+16.04.20151229-0~467~ubuntu14.04.1
Candidate: 0.4.43+16.04.20160203-0~606~ubuntu14.04.1
Version table:
0.4.43+16.04.20160203-0~606~ubuntu14.04.1 0
500 http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu/ trusty/main amd64 Packages
*** 0.4.42+16.04.20151229-0~467~ubuntu14.04.1 0
100 /var/lib/dpkg/status
0.4.21.1ubuntu0.2 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
0.4.21.1 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty/main amd64 Packages
click-dev:
Installed: 0.4.42+16.04.20151229-0~467~ubuntu14.04.1
Candidate: 0.4.43+16.04.20160203-0~606~ubuntu14.04.1
Version table:
0.4.43+16.04.20160203-0~606~ubuntu14.04.1 0
500 http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu/ trusty/main amd64 Packages
*** 0.4.42+16.04.20151229-0~467~ubuntu14.04.1 0
100 /var/lib/dpkg/status
0.4.21.1ubuntu0.2 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
0.4.21.1 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty/main amd64 Packages
gir1.2-click-0.4:
Installed: 0.4.42+16.04.20151229-0~467~ubuntu14.04.1
Candidate: 0.4.43+16.04.20160203-0~606~ubuntu14.04.1
Version table:
0.4.43+16.04.20160203-0~606~ubuntu14.04.1 0
500 http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu/ trusty/main amd64 Packages
*** 0.4.42+16.04.20151229-0~467~ubuntu14.04.1 0
100 /var/lib/dpkg/status
0.4.21.1ubuntu0.2 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
0.4.21.1 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty/main amd64 Packages
libclick-0.4-0:
Installed: 0.4.42+16.04.20151229-0~467~ubuntu14.04.1
Candidate: 0.4.43+16.04.20160203-0~606~ubuntu14.04.1
Version table:
0.4.43+16.04.20160203-0~606~ubuntu14.04.1 0
500 http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu/ trusty/main amd64 Packages
*** 0.4.42+16.04.20151229-0~467~ubuntu14.04.1 0
100 /var/lib/dpkg/status
0.4.21.1ubuntu0.2 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
0.4.21.1 0
500 http://mirror.vutbr.cz/ubuntu/archive/ trusty/main amd64 Packages
调试:
apt-get -o Debug::pkgProblemResolver=true install click click-dev gir1.2-click-0.4 libclick-0.4-0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following extra packages will be installed:
python3-click-package
Suggested packages:
ubuntu-app-launch-tools upstart-app-launch-tools
Recommended packages:
debootstrap
The following packages will be REMOVED:
python3-click
The following NEW packages will be installed:
python3-click-package
The following packages will be upgraded:
click click-dev gir1.2-click-0.4 libclick-0.4-0
4 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 146 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n]
问题的重现:
apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
click click-dev gir1.2-click-0.4 libclick-0.4-0
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
修复后:
apt-get install click click-dev gir1.2-click-0.4 libclick-0.4-0
Reading package lists... Done
Building dependency tree
Reading state information... Done
click-dev is already the newest version.
click-dev set to manually installed.
click is already the newest version.
libclick-0.4-0 is already the newest version.
libclick-0.4-0 set to manually installed.
gir1.2-click-0.4 is already the newest version.
gir1.2-click-0.4 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
答案1
根据海报,以下命令有效
apt-get -o Debug::pkgProblemResolver=true install click click-dev gir1.2-click-0.4 libclick-0.4-0
并给出结果
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following extra packages will be installed:
python3-click-package
Suggested packages:
ubuntu-app-launch-tools upstart-app-launch-tools
Recommended packages:
debootstrap
The following packages will be REMOVED:
python3-click
The following NEW packages will be installed:
python3-click-package
The following packages will be upgraded:
click click-dev gir1.2-click-0.4 libclick-0.4-0
4 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 146 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n]
因此,运行显式apt-get install
.
我要求发布者在没有调试标志的情况下运行它,看看它是否给出相同的结果,但显然他已经运行了调试版本。
答案2
当所识别的包的依赖关系发生更改并且需要安装新的包时,就会发生这种情况。我们需要使用 dist-upgrade 来安装新的依赖项并升级软件包:
sudo apt-get dist-upgrade
检查损坏的依赖关系
apt-get check
修复损坏的包
apt-get -f install
删除系统上不再安装的软件包的 .deb 文件
apt-get autoclean
保留所需的包裹
echo "<package_name> hold" | dpkg --set-selections
重新配置指定的包:
dpkg-reconfigure <package_name>
答案3
升级版本/软件包后,错误“以下软件包已被保留”确实经常发生。
软件包是从另一个存储库安装的,或者由于软件包错误不那么频繁,某些依赖性未得到满足,或者在没有用户干预的情况下无法满足其他要求,包括在特定软件包的有些不兼容版本之间做出重大升级的决定。
在某些情况下,执行 apt-get install 软件包名称就足够了,而在其他情况下,则需要添加缺少的存储库。
关于你的情况,我发现了这个帖子:
看来 beta PPA 中的 ubuntu-device-flash 包需要依赖包“click-ubuntu-policy”,在 Trusty 中找不到,添加 ppa:snappy-dev/tools 然后我认为可以安装 snappy-tools,可以您帮助验证此解决方案并提交有关此问题的错误吗?