#!/bin/bash # Author: Andrew Shark # Script version: 01 # If you forget to remove previous version of amdgpu-pro before installing a new one, you may stuck at situation with lots of broken packages, and amdgpu-uninstall script could not fix that. # In this case run this script to forcely remove packages belonging to amdgpu-pro. # If it messed up in /usr/lib/x86_64-linux-gnu/dri/, then reinstall libgl1-mesa-dri and mesa-va-drivers pkgs_to_rm=$(dpkg-query -W -f='${binary:Package}\t${Version}\t${Maintainer}\n' | \ egrep "slava.grigorev@amd.com|gpudriverdevsupport@amd.com|you@email.com" | \ cut -f1) if [ "$pkgs_to_rm" != "" ]; then echo "Removing previously installed packages..." sudo dpkg --purge --force-remove-reinstreq --force-depends $pkgs_to_rm > /dev/null fi # this will remove local repository and amdgpu-pro-pin package if which amdgpu-uninstall >/dev/null; then echo "Removing previous local repository..." amdgpu-uninstall -y > /dev/null elif which amdgpu-pro-uninstall >/dev/null; then echo "Removing previous local repository..." amdgpu-pro-uninstall -y > /dev/null fi