在 Ubuntu 18.10 上安装 amdgpu-pro 已损坏 apt E: 子进程 /usr/bin/dpkg 返回错误代码 (1)

在 Ubuntu 18.10 上安装 amdgpu-pro 已损坏 apt E: 子进程 /usr/bin/dpkg 返回错误代码 (1)

我尝试按照本指南在 Ubuntu 18.10 上安装 amdgpu-pro 驱动程序,但安装失败,提示驱动程序仅适用于 18.04。

https://linuxconfig.org/how-to-install-amd-radeon-drivers-on-ubuntu-18-10-cosmic-cuttlefish-linux

现在 apt 已经完全崩溃了,当我尝试运行 apt Upgrade 时,我收到以下错误消息:

 /tmp/apt-dpkg-install-4A1LcU/03-amdgpu-core_19.20-812932_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试过,sudo dpkg --configure -a但是这会返回大量依赖错误,因为Package amdgpu-core is not installed.

然后我尝试apt install -f解决该问题,但收到错误:

ERROR: This package can only be installed on Ubuntu 18.04.
dpkg: error processing archive /var/opt/amdgpu-pro-local/./amdgpu-core_19.20-812932_all.deb (--unpack):
 new amdgpu-core package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/opt/amdgpu-pro-local/./amdgpu-core_19.20-812932_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我尝试apt autoremove清理它,但收到错误:

E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

所以我运行了该命令sudo apt --fix-broken install并收到更多错误:

Preparing to unpack .../amdgpu-core_19.20-812932_all.deb ...
ERROR: This package can only be installed on Ubuntu 18.04.
dpkg: error processing archive /var/opt/amdgpu-pro-local/./amdgpu-core_19.20-812932_all.deb (--unpack):
 new amdgpu-core package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/opt/amdgpu-pro-local/./amdgpu-core_19.20-812932_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以我似乎陷入了一个无法摆脱的循环。有人知道我需要做什么才能将其删除并重新工作吗?

答案1

我通过以下方式解决了这个问题:

步骤1:sudo dpkg --configure -a

步骤2:sudo dpkg -P错误包(步骤1中可以看到的错误包)

就我而言,他们是

dependency problems - leaving unconfigured
Errors were encountered while processing:
 libgl1-amdgpu-mesa-dri:amd64
 libwayland-amdgpu-server0:amd64
 libgbm1-amdgpu:amd64
 libwayland-amdgpu-egl1:amd64
 gst-omx-amdgpu
 glamor-amdgpu:amd64
 libllvm9.0-amdgpu:amd64
 libglapi-amdgpu-mesa:amd64
 mesa-amdgpu-vdpau-drivers:amd64
 libgles1-amdgpu-mesa:amd64
 libdrm2-amdgpu:amd64
 libegl1-amdgpu-mesa-drivers:amd64
 mesa-amdgpu-va-drivers:amd64
 xserver-xorg-amdgpu-video-amdgpu
 mesa-amdgpu-omx-drivers:amd64
 libegl1-amdgpu-mesa:amd64
 libdrm-amdgpu-common
 libwayland-amdgpu-client0:amd64
 libgl1-amdgpu-mesa-glx:amd64
 libgles2-amdgpu-mesa:amd64
 libxatracker2-amdgpu:amd64
 libosmesa6-amdgpu:amd64
 libdrm-amdgpu-amdgpu1:amd64

步骤 3:sudo apt autoremove

那么依赖问题应该就消失了。

相关内容