无法安装 Ubuntu 桌面(依赖于无线工具,但无法安装)

无法安装 Ubuntu 桌面(依赖于无线工具,但无法安装)

我正在尝试在我的 Ubuntu 17.10 最小版本上安装 Ubuntu 桌面。安装过程一切顺利,直到安装时才wireless-tools需要安装依赖项。

尝试安装时出现以下错误

Preparing to unpack .../wireless-tools_30~pre9-12ubuntu1_amd64.deb ...
Unpacking wireless-tools (30~pre9-12ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/wireless-tools_30~pre9-12ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/sbin/iwconfig', which is also in package wireless-tools-udeb 30~pre9-8ubuntu1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package ubuntu-desktop.
Preparing to unpack .../ubuntu-desktop_1.404.1_amd64.deb ...
Unpacking ubuntu-desktop (1.404.1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/wireless-tools_30~pre9-12ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

尝试运行sudo apt --fix-broken得到相同的输出结果。

有人知道我该怎么办吗?

我已经尝试重新启动并sudo apt update运行sudo apt upgrade

我已经尝试清除所有内容并再次安装,但结果还是一样。

我也尝试过手动下载包并清除缓存,然后以这种方式安装,但这导致了同样的问题。

答案1

仔细阅读错误信息:

dpkg: error processing archive /var/cache/apt/archives/wireless-tools_30~pre9-12ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/sbin/iwconfig', which is also in package wireless-tools-udeb 30~pre9-8ubuntu1

让我们稍微分析一下:

dpkg: error processing archive A (--unpack): trying to overwrite 'FILE', which is also in package B

FILE 一次只能由一个包提供。当两个包(A 和 B)都尝试提供 FILE 时,这两个包冲突。您不能同时安装两者。

因为您想要 A,所以您必须卸载 B,或者您必须 --force 安装 A。

答案2

我最终从 launchpad 下载了最新的 deb,然后运行sudo dpkg -i --force-overwrite wireless-tools_30~pre9-5ubuntu2_amd64.debsudo reboot,它就工作了!

相关内容