无法升级 debhelper

无法升级 debhelper

我的笔记本电脑上运行着 Ubuntu 16.04,正常流程几乎每天都要升级,今天当我输入“sudo apt list --upgradable”时,它显示了以下消息:

❯sudo apt list --upgradable
 Listing... Done
 debhelper/xenial,xenial 10.2.2ubuntu1~ubuntu16.04.1 all [upgradable from:9.20160115ubuntu3]
 N: There is 1 additional version. Please use the '-a' switch to see it

因此我按照建议进行操作,输入:

❯sudo dh -a
 dh: No compatibility level specified in debian/compat
 dh: This package will soon FTBFS; time to fix it!
 dh: Compatibility levels before 4 are no longer supported (level 1 requested)

然后我跑了:

sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

为什么它没有升级 dh?我该怎么做才能解决这个问题?

先感谢您。

答案1

遗憾的是我暂时无法评论,我遇到了同样的问题。如果你实际运行:

sudo apt upgrade debhelper

它返回一个错误,指出

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:
 debhelper : Depends: dh-autoreconf (>= 12~) but 11 is to be installed
             Depends: dh-strip-nondeterminism (>= 0.028~) but 0.015-1 is to be installed
             Depends: dpkg-dev (>= 1.18.23ubuntu3) but 1.18.4ubuntu1.3 is to be installed
E: Broken packages

至少 II 在 KDE Neon LTS(基于 16.04)上运行,所以我认为只有包管理器才能修复该错误。

答案2

在几乎到处寻找复杂的解决方案之后,我决定尝试一些更简单、更透明的方法:使用 aptitude

sudo aptitude update

它发现了一些破损的包裹,然后:

sudo aptitude upgrade

它问我是否要修复损坏的包,我输入“y”然后它开始修复所有损坏的包。

我希望这个解决方案也能帮助您。

相关内容