sudo apt update; sudo apt upgrade
前几天尝试运行,出现了一个关于 dpkg 的错误,这是我以前从未见过的,而且谷歌似乎也没有提供太多帮助。
我仅粘贴输出,因为我不知道发生了什么:
sudo apt upgrade
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:
steam:i386 : Depends: steam-devices:i386
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
hunspell-bn hunspell-bs hunspell-gu hunspell-hi hunspell-is hunspell-si hunspell-te
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
steam-devices
The following NEW packages will be installed:
steam-devices
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
20 not fully installed or removed.
Need to get 0 B/26.0 kB of archives.
After this operation, 79.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 531568 files and directories currently installed.)
Preparing to unpack .../steam-devices_1.0.0.59-2_all.deb ...
Unpacking steam-devices (1.0.0.59-2) ...
dpkg: error processing archive /var/cache/apt/archives/steam-devices_1.0.0.59-2_all.deb (--unpack):
trying to overwrite '/lib/udev/rules.d/60-steam-input.rules', which is also in package steam-launcher 1.0.0.59
Errors were encountered while processing:
/var/cache/apt/archives/steam-devices_1.0.0.59-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
有没有比我更熟悉 apt 和包管理的人能解释一下这些错误的含义以及我该如何诊断/修复问题。我真的不知道从哪里开始。
系统是 debian 9(我认为)
答案1
最近我遇到了同样的问题,在我的 Debian 9 上收到 Steam 发出的缺少依赖项通知后,我寻找解决方法。我已在其上安装了 Synaptic 包管理器(您可能也默认安装了它),因此我设法从那里删除了损坏的包:
- 界面左侧的软件包按状态分类:已安装、未安装、损坏……)。您需要检查损坏的软件包并点击“应用”按钮。
- 然后我从 Synaptic 升级了 Debian(“标记所有升级”,然后“应用”)
- 然后
steam-devices:i386
像往常一样从终端安装。 - 我遵循了 apt 的所有建议(安装了适用于我的图形驱动程序的所有推荐软件包等)并让我的 Steam 正常运行。
如果您是 Synaptic 的新用户,您需要知道您需要以 root 身份才能使用它(它会询问),并且当 Synaptic 打开时,您将无法从命令行使用 apt。