在 20.04 (focal) 上安装 snmp 和 snmp:i386 包 -issue

在 20.04 (focal) 上安装 snmp 和 snmp:i386 包 -issue

注意:这个问题与默认存储库无关

我需要安装最新的 sane 软件包,因为我的扫描仪不受 Ubuntu 20.04 LTS 中包含的主要 10.29 libsane 的支持。最新的libsane软件包依赖于snmp。最新的 Wine 也需要 i386 版本的软件包libsane,但由于依赖性而无法安装snmp

看起来只允许一个 snmp。

执行的任务:

sudo dpkg --add-architecture i386
sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.canonical.com/ubuntu focal InRelease                      
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease                 
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease               
Hit:5 http://archive.ubuntu.com/ubuntu focal-security InRelease                
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Get:7 http://archive.ubuntu.com/ubuntu focal/main Translation-en_GB [485 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/restricted Translation-en_GB [3.860 B]
Get:9 http://archive.ubuntu.com/ubuntu focal/universe Translation-en_GB [319 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en_GB [105 kB]
Fetched 913 kB in 3s (357 kB/s)                                        
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up-to-date.

这有效:

sudo apt install snmp

失败了:

sudo apt install snmp:i386
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.
 dconf-gsettings-backend : Depends: dconf-service (>= 0.36.0-1)
                           Depends: dconf-service (< 0.36.0-1.1~)
 dictionaries-common : Depends: libtext-iconv-perl but it is not going to be installed
 libcurl3-gnutls : Depends: libssh-4 (>= 0.8.0) but it is not going to be installed
 librdf0 : Depends: libraptor2-0 (>= 2.0.14) but it is not going to be installed
           Depends: librasqal3 (>= 0.9.31) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

我也尝试从 进行安装.deb。此方法有效:

wget http://mirrors.kernel.org/ubuntu/pool/main/n/net-snmp/snmp_5.8+dfsg-2ubuntu2.3_amd64.deb

sudo dpkg -i snmp_5.8+dfsg-2ubuntu2.3_amd64.deb

这也有效:

wget http://mirrors.kernel.org/ubuntu/pool/main/n/net-snmp/snmp_5.8+dfsg-2ubuntu2.3_i386.deb

sudo dpkg -i snmp_5.8+dfsg-2ubuntu2.3_i386.deb

但是,这个包仍然坏了。为了修复它,我必须执行以下操作:

apt --fix-broken install

这将替换snmp:i38664 位版本snmp

或者这可能更清楚一点:

sudo apt install -s --no-install-recommends snmp snmp:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
snmp is already the newest version (5.8+dfsg-2ubuntu2.3).
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.
 snmp : Conflicts: snmp:i386 but 5.8+dfsg-2ubuntu2.3 is to be installed
 snmp:i386 : Conflicts: snmp but 5.8+dfsg-2ubuntu2.3 is to be installed
E: Unable to correct problems, you have held broken packages.

有没有什么办法可以解决这个问题?我该如何安装两个版本snmp


答案中的前 3 个命令成功运行,然后:

$ sudo apt-get install snmp:i386

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.
 dconf-gsettings-backend : Depends: dconf-service (>= 0.36.0-1)
                           Depends: dconf-service (< 0.36.0-1.1~)
 dictionaries-common : Depends: libtext-iconv-perl but it is not going to be installed
 librdf0 : Depends: libraptor2-0 (>= 2.0.14) but it is not going to be installed
           Depends: librasqal3 (>= 0.9.31) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

答案1

首先你必须恢复官方默认存储库和ppa-purge第三方SNMP与系统相关的 PPA。

那么你必须尝试以下方法:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libsnmp35:i386
sudo apt-get install snmp:i386

您还应该知道,使用低级dpkg工具安装软件包是危险的,它可能会破坏您的系统。

相关内容