尝试安装时aptitude
抛出apt
此错误:
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:
aptitude : Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
但是,当我尝试安装时,libapt-pkg5.0
它显示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapt-pkg5.0 is already the newest version (1.8.0~alpha3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
我使用的是 Debian 9.6。
答案1
您在 Debian 9(延伸)系统上安装了一个前测试/不稳定的软件包,这是不应该完成的。
/stable
您可以通过附加到阻止包来强制降级到稳定版。但请注意,不支持降级软件包。因此,降级包装管理系统的某些部分是危险的:如果出现问题,您可能会失去对apt-get
命令的访问权限。
apt
如果有多个相关依赖项需要同时解决(如果您升级了所有相关包),则可以在同一行中多次使用多个包。顺便说一下,1.8.0~alpha3
最近的 Debian 漏洞仍然存在,因为它在1.8.0~alpha3.1
.这与失败的风险相结合会导致:
apt-get -o Acquire::http::AllowRedirect=false update
apt-get -o Acquire::http::AllowRedirect=false -o APT::Clean-Installed=false install libapt-pkg5.0/stable
您可能需要apt/stable
在最后一行添加其他相关包(可能还有其他包)。该命令应该告诉哪些软件包具有相同的版本1.8.0~alpha3
,因此可能需要在上面的命令中添加:
dpkg -l|awk '/^.i/ && $3 == "1.8.0~alpha3"'
在任何此类降级之后,谨慎的做法是在第二个命令中再次重新安装相同的软件包:
apt-get --reinstall install libapt-pkg5.0
在这种降级破坏了命令的真正意外情况下apt-get
,您仍然可以dpkg
使用该命令并且仍然可以保存软件包/var/cache/apt/archives/
来拯救您。