![apt 和 dbkg 的问题](https://linux22.com/image/895346/apt%20%E5%92%8C%20dbkg%20%E7%9A%84%E9%97%AE%E9%A2%98.png)
当我使用 apt 命令(例如 install、remove、autoremove 等)时,只打印了下面的输出,这与我之前打算使用 dpkg 命令安装的 openvpn 包安装失败有关。事实上,每次我使用 apt 和 dpkg cpmmands 时,系统都会尝试重新安装之前安装失败的包。如何解决这个问题?
sudo apt install tree
[sudo] password for hosein:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openvpn:i386 : Depends: liblzo2-2:i386 but it is not going to be installed
Depends: libpam0g:i386 (>= 0.99.7.1) but it is not going to be installed
Depends: libpkcs11-helper1:i386 (>= 1.11) but it is not going to be installed
Depends: libssl1.0.0:i386 (>= 1.0.2~beta3) but it is not going to be installed
Depends: libsystemd0:i386 but it is not going to be installed
tree : Conflicts: tree:i386 but 1.5.3-2 is to be installed
tree:i386 : Conflicts: tree but 1.7.0-3 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
答案1
尝试
$ sudo apt-get -f install
这将尝试修复依赖性问题并重新配置您的软件包。此外,命令dpkg --reconfigure
可能有助于解决。
答案2
我的问题通过以下命令解决:rm /var/lib/dpkg/info/*