帮助在 Ubuntu 18.04 中安装 AMD GPU 驱动程序

帮助在 Ubuntu 18.04 中安装 AMD GPU 驱动程序

我正在升级我的 AMD GPU 驱动程序。安装失败,现在我似乎也无法将其删除。有人遇到过这种情况吗?

matiwal@MatiBuntu:~/Downloads/amdgpu-pro-18.30-633530$ ./amdgpu-install -y
deb [ trusted=yes ] file:/var/opt/amdgpu-pro-local/ ./
Get:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Ign:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]          
Get:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg                            
Ign:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg                            

Fetched 172 kB in 1s (253 kB/s)                                                
Reading package lists... Done
Package: *amdgpu*
Pin: release o=AMD
Pin: version *-633530
Pin-Priority: 1000

Package: *amdgpu*:i386
Pin: release o=AMD
Pin: version *-633530
Pin-Priority: 1000

Reading package lists... Done
Building dependency tree       
Reading state information... Done
amdgpu is already the newest version (18.30-633530).
amdgpu-lib32 is already the newest version (18.30-633530).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
 amdgpu : Depends: libdrm-amdgpu-common (= 1.0.0-633530) but it is not going to be installed
 libdrm-amdgpu-amdgpu1:i386 : Depends: libdrm-amdgpu-common:i386
 libdrm-amdgpu-amdgpu1 : Depends: libdrm-amdgpu-common but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

运行apt --fix-broken安装给我:

matiwal@MatiBuntu:~/Downloads/amdgpu-pro-18.30-633530$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  ids-amdgpu
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libdrm-amdgpu-common
The following NEW packages will be installed
  libdrm-amdgpu-common
0 to upgrade, 1 to newly install, 0 to remove and 46 not to upgrade.
44 not fully installed or removed.
Need to get 0 B/6,732 B of archives.
After this operation, 28.7 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 file:/var/opt/amdgpu-pro-local ./ libdrm-amdgpu-common 1.0.0-633530 [6,732 B]
(Reading database ... 224293 files and directories currently installed.)
Preparing to unpack .../libdrm-amdgpu-common_1.0.0-633530_all.deb ...
Unpacking libdrm-amdgpu-common (1.0.0-633530) ...
dpkg: error processing archive /var/opt/amdgpu-pro-local/./libdrm-amdgpu-common_1.0.0-633530_all.deb (--unpack):
 trying to overwrite '/opt/amdgpu/share/libdrm/amdgpu.ids', which is also in package ids-amdgpu 1.0.0-606296
Errors were encountered while processing:
/var/opt/amdgpu-pro-local/./libdrm-amdgpu-common_1.0.0-633530_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

尝试强制删除损坏的包装时出现以下情况:

$ sudo dpkg --remove --force-remove-reinstreq amdgpu
dpkg: dependency problems prevent removal of amdgpu:
 amdgpu-lib32 depends on amdgpu (= 18.30-633530).

dpkg: error processing package amdgpu (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 amdgpu
matiwal@MatiBuntu:~/Downloads/amdgpu-pro-18.30-633530$ 

答案1

昨天也遇到了这个问题。这是我的解决方法:

  1. sudo apt autoremove amdgpu*
  2. sudo apt install --reinstall $(uname -r)
  3. reboot
  4. 进入包含 amdgpu 驱动程序的文件夹并运行./amdgpu-install -y
  5. reboot
  6. sudo apt update && sudo apt install amdgpu*
  7. reboot
  8. sudo apt --fix-broken install
  9. sudo apt -f install
  10. reboot

问题解决

相关内容