Score:3

Issues uninstalling amdgpu-dkms after upgrading to Ubuntu 23.04

US flag

I'm having some issues after upgrading to Ubuntu 23.04 (from 22.10). I had the proprietary AMD drivers installed for my video card, and after the upgrade the amdgpu-dkms package is causing me apt errors:

$ sudo amdgpu-uninstall
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gcc-11-base libasan6 libdrm-dev libelf-dev libgcc-11-dev libncurses-dev libomxil-bellagio-bin libomxil-bellagio0 libpciaccess-dev libstdc++-11-dev libtinfo-dev
  libtsan0 zlib1g-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  amdgpu-core* amdgpu-dkms* amdgpu-dkms-firmware* amdgpu-lib* amdgpu-lib32* comgr* gst-omx-amdgpu* hip-runtime-amd* hsa-rocr* hsa-rocr-dev* hsakmt-roct-dev*
  libdrm-amdgpu-amdgpu1* libdrm-amdgpu-amdgpu1:i386* libdrm-amdgpu-common* libdrm-amdgpu-radeon1* libdrm-amdgpu-radeon1:i386* libdrm2-amdgpu* libdrm2-amdgpu:i386*
  libegl1-amdgpu-mesa* libegl1-amdgpu-mesa:i386* libegl1-amdgpu-mesa-drivers* libegl1-amdgpu-mesa-drivers:i386* libgbm1-amdgpu* libgbm1-amdgpu:i386*
  libgl1-amdgpu-mesa-dri* libgl1-amdgpu-mesa-dri:i386* libgl1-amdgpu-mesa-glx* libgl1-amdgpu-mesa-glx:i386* libglapi-amdgpu-mesa* libglapi-amdgpu-mesa:i386*
  libllvm15.0.50403-amdgpu* libllvm15.0.50403-amdgpu:i386* libxatracker2-amdgpu* libxatracker2-amdgpu:i386* mesa-amdgpu-omx-drivers* mesa-amdgpu-va-drivers*
  mesa-amdgpu-va-drivers:i386* mesa-amdgpu-vdpau-drivers* mesa-amdgpu-vdpau-drivers:i386* openmp-extras-runtime* rocm-core* rocm-hip-runtime* rocm-language-runtime*
  rocm-llvm* rocm-ocl-icd* rocm-opencl* rocm-opencl-runtime* rocminfo* xserver-xorg-amdgpu-video-amdgpu*
0 upgraded, 0 newly installed, 49 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 1,382 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: warning: files list file for package 'amdgpu-dkms-firmware' missing; assuming package has no files currently installed
(Reading database ... 345517 files and directories currently installed.)
Removing amdgpu-dkms (1:5.18.13.50403-1538762.22.04) ...
Deleting module amdgpu-5.18.13-1538762.22.04 completely from the DKMS tree.
update-initramfs: Generating /boot/initrd.img-5.19.0-38-generic
grep: /boot/config-5.19.0-38-generic: No such file or directory
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
grep: /boot/config-5.19.0-38-generic: No such file or directory
E: gzip compression (CONFIG_RD_GZIP) not supported by kernel
update-initramfs: failed for /boot/initrd.img-5.19.0-38-generic with 1.
dpkg: error processing package amdgpu-dkms (--remove):
 installed amdgpu-dkms package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 amdgpu-dkms
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm trying to uninstall all the proprietary AMD GPU drivers, but I don't seem to be able to. The uninstall script is complaining about some missing headers (grep: /boot/config-5.19.0-38-generic: No such file or directory), which I think were uninstalled as part of the upgrade, and are not available in the 23.04 repos. I managed to install them by hand, but I'm still seeing the same error.

At the moment, my goal is to uninstall the drivers entirely, but I don't know how to force it to remove the package. I could also be looking at this wrong, and there's a better solution. Can anyone suggest anything that could help here?

Current Kernel:

$ uname -r
6.2.0-20-generic

Apt Cache:

$ apt-cache policy amdgpu amdgpu-dkms
amdgpu:
  Installed: (none)
  Candidate: 1:5.4.50403-1538762.22.04
  Version table:
     1:5.4.50403-1538762.22.04 600
        600 https://repo.radeon.com/amdgpu/5.4.3/ubuntu jammy/main amd64 Packages
amdgpu-dkms:
  Installed: 1:5.18.13.50403-1538762.22.04
  Candidate: 1:5.18.13.50403-1538762.22.04
  Version table:
 *** 1:5.18.13.50403-1538762.22.04 600
        600 https://repo.radeon.com/amdgpu/5.4.3/ubuntu jammy/main amd64 Packages
        600 https://repo.radeon.com/amdgpu/5.4.3/ubuntu jammy/main i386 Packages
        100 /var/lib/dpkg/status

DKMS Status:

$ dkms status
openrazer-driver/3.5.1, 5.19.0-38-generic, x86_64: installed
openrazer-driver/3.5.1, 5.19.0-41-generic, x86_64: installed
openrazer-driver/3.5.1, 6.2.0-20-generic, x86_64: installed
brigzzy avatar
md
@Nmath Well, I got better performance in games with the proprietary ones. There was no issue installing them, but I installed them on 22.10, before the upgrade.
Score:3
US flag

A friend offered some advice, and we managed to get it working! In my case, this was the fix:

sudo dpkg --remove --force-remove-reinstreq amdgpu-dkms
cd /var/lib/dpkg/info
sudo rm amdgpu-dkms.*
sudo apt -f install

From there I was able to run sudo amdgpu-uninstall to uninstall the rest of the packages. Thanks folks!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.