由于软件包被扣留,无法将 19.04 升级到 19.10:libsnmp30

由于软件包被扣留,无法将 19.04 升级到 19.10:libsnmp30

运行将 19.04 升级到 19.10 时update-manager,我在控制台中收到以下信息:

Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

do-release-upgrade

$ do-release-upgrade 
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

因此尝试upgrade

$ sudo apt-get upgrade 
The following packages have been kept back:
  libsnmp30
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

事实上,我似乎无法安装任何东西:

$ sudo apt-get install emacs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libsnmp30 : Depends: libsensors5 (>= 1:3.5.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

尝试--fix-broken

$ sudo apt --fix-broken install
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libsnmp30 : Depends: libsensors5 (>= 1:3.5.0) but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

无论如何,libsnmp30 似乎是罪魁祸首。尝试安装时libsnmp30,我得到了以下信息:

$ sudo apt-get install libsnmp30
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:
 libsnmp30 : Depends: libsensors5 (>= 1:3.5.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后尝试libsensors5

$ sudo apt-get install libsensors5    
The following packages have unmet dependencies:
 libsensors5 : Depends: libsensors-config but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后尝试libsensors-config,这是看起来足够可怕的结果:

$ sudo apt-get install libsensors-config
The following additional packages will be installed:
  policykit-1-gnome
Suggested packages:
  lm-sensors
The following packages will be REMOVED:
  apturl cheese chrome-gnome-shell colord default-jre deja-dup evolution-data-server gdm3 gir1.2-gst-plugins-base-1.0 gir1.2-mutter-2
  gir1.2-mutter-4 gir1.2-rb-3.0 gir1.2-totem-1.0 gnome-initial-setup gnome-online-accounts gnome-session-bin gnome-shell gnome-shell-extension-appindicator
  [ ... lots and lots of packages ... ]
The following NEW packages will be installed:
  libsensors-config policykit-1-gnome
0 upgraded, 2 newly installed, 120 to remove and 0 not upgraded.

吉克!

更多信息:

$ apt-cache policy libsnmp30
libsnmp30:
  Installed: 5.7.3+dfsg-1.8ubuntu3.1
  Candidate: 5.7.3+dfsg-5ubuntu1.2
  Version table:
     5.7.3+dfsg-5ubuntu1.2 500
        500 http://se.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
     5.7.3+dfsg-5ubuntu1 500
        500 http://se.archive.ubuntu.com/ubuntu disco/main amd64 Packages
 *** 5.7.3+dfsg-1.8ubuntu3.1 100
        100 /var/lib/dpkg/status

Libsensors 信息:

$ apt-cache policy libsensors5 libsensors-config
libsensors5:
  Installed: (none)
  Candidate: 1:3.5.0-3ubuntu1
  Version table:
     1:3.5.0-3ubuntu1 500
        500 http://se.archive.ubuntu.com/ubuntu disco/main amd64 Packages
libsensors-config:
  Installed: (none)
  Candidate: 1:3.5.0-3ubuntu1
  Version table:
     1:3.5.0-3ubuntu1 500
        500 http://se.archive.ubuntu.com/ubuntu disco/main amd64 Packages
        500 http://se.archive.ubuntu.com/ubuntu disco/main i386 Packages

移除libsensors4

$ sudo apt remove libsensors4
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dri : Depends: libsensors4 (>= 1:3.0.0) but it is not going to be installed
 libsensors-config : Conflicts: libsensors4:i386 but 1:3.4.0-4 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

相关信息libgl1-mesa-dri

$ apt-cache policy libgl1-mesa-dri
libgl1-mesa-dri:
  Installed: 19.3~git1908270730.e6eb44~oibaf~b
  Candidate: 19.3~git1908270730.e6eb44~oibaf~b
  Version table:
 *** 19.3~git1908270730.e6eb44~oibaf~b 100
        100 /var/lib/dpkg/status
     19.0.8-0ubuntu0~19.04.1 500
        500 http://se.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
     19.0.2-1ubuntu1 500
        500 http://se.archive.ubuntu.com/ubuntu disco/main amd64 Packages

答案1

ppa安装的软件包在某个时候被删除了(可能是在早期的 Ubuntu 升级中),但从中安装的软件包ppa仍然在您的系统上,从而导致依赖性问题。

从你的apt输出来看,似乎是ppa:oibaf/图形驱动程序

尝试再次添加相同的内容ppa,它似乎适用于宇宙:

sudo add-apt-repository ppa:oibaf/graphics-drivers

然后运行

sudo apt --fix-broken install

如果有效的话,你可以删除它ppa和它的所有包,如果你喜欢使用ppa-purge

sudo apt install ppa-purge
sudo ppa-purge ppa:oibaf/graphics-drivers

最后,我会发出清理未引用的包的命令:

sudo apt autoremove

相关内容