Ubuntu uninstall AMD drivers

$ /usr/bin/amdgpu-pro-uninstall
bash: /usr/bin/amdgpu-pro-uninstall: No such file or directory
$ /usr/bin/amdgpu-uninstall
bash: /usr/bin/amdgpu-uninstall: No such file or directory

 

dpkg: error processing archive /var/opt/amdgpu-pro-local/./amdgpu-dkms-firmware_5.9.10.69-1234664_all.deb (–unpack):
trying to overwrite ‘/usr/share/doc/amdgpu-dkms-firmware/LICENSE’, which is also in package rock-dkms-firmware 1:4.1-26
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/opt/amdgpu-pro-local/./amdgpu-dkms-firmware_5.9.10.69-1234664_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

 

$ dpkg –list | grep amdgpu
ii amdgpu-pin 20.50-1234664 all Meta package to pin a specific amdgpu driver version.
ii amdgpu-pro-pin 20.50-1234664 all Meta package to pin a specific amdgpu pro driver version.
ii libdrm-amdgpu1:amd64 2.4.102-1ubuntu1~20.04.1 amd64 Userspace interface to amdgpu-specific kernel DRM services — runtime
ii rock-dkms 1:4.1-26 all amdgpu driver in DKMS format.
ii rock-dkms-firmware 1:4.1-26 all firmware blobs used by amdgpu driver in DKMS format
ii xserver-xorg-video-amdgpu 19.1.0-1 amd64 X.Org X server — AMDGPU display driver

 

In order to remove broken packages, or packages which weren’t fully installed we will run

sudo su
sudo apt-get clean && apt-get autoremove
sudo apt-get -f install
sudo dpkg --configure -a
# dpkg -r rock-dkms
(Reading database ... 170365 files and directories currently installed.)
Removing rock-dkms (1:4.1-26) ...

-------- Uninstall Beginning --------
Module: amdgpu
Version: 4.1-26
Kernel: 5.8.0-48-generic (x86_64)
-------------------------------------

...
# dpkg -r rock-dkms
(Reading database ... 170365 files and directories currently installed.)
Removing rock-dkms (1:4.1-26) ...

-------- Uninstall Beginning --------
Module: amdgpu
Version: 4.1-26
Kernel: 5.8.0-48-generic (x86_64)
-------------------------------------

Noyice the rc before the rock-dkms

# dpkg --list | grep amdgpu
ii amdgpu-pin 20.50-1234664 all Meta package to pin a specific amdgpu driver version.
ii amdgpu-pro-pin 20.50-1234664 all Meta package to pin a specific amdgpu pro driver version.
ii libdrm-amdgpu1:amd64 2.4.102-1ubuntu1~20.04.1 amd64 Userspace interface to amdgpu-specific kernel DRM services -- runtime
rc rock-dkms 1:4.1-26 all amdgpu driver in DKMS format.
ii rock-dkms-firmware 1:4.1-26 all firmware blobs used by amdgpu driver in DKMS format
ii xserver-xorg-video-amdgpu 19.1.0-1 amd64 X.Org X server -- AMDGPU display driver
# dpkg --purge rock-dkms 
(Reading database ... 167742 files and directories currently installed.)
Purging configuration files for rock-dkms (1:4.1-26) ...


# dpkg --list | grep amdgpu
ii amdgpu-pin 20.50-1234664 all Meta package to pin a specific amdgpu driver version.
ii amdgpu-pro-pin 20.50-1234664 all Meta package to pin a specific amdgpu pro driver version.
ii libdrm-amdgpu1:amd64 2.4.102-1ubuntu1~20.04.1 amd64 Userspace interface to amdgpu-specific kernel DRM services -- runtime
ii xserver-xorg-video-amdgpu 19.1.0-1 amd64 X.Org X server -- AMDGPU display driver

Run one last time

$ /usr/bin/amdgpu-pro-uninstall
bash: /usr/bin/amdgpu-pro-uninstall: No such file or directory
$ /usr/bin/amdgpu-uninstall
bash: /usr/bin/amdgpu-uninstall: No such file or directory

Install the ubuntu amd pro drivers :

# ./amdgpu-pro-install -y --opencl=legacy