The most thorough removal attempt involves running two commands. However, there are several possible variants of the first command. In general, the two commands look like this (in pseudo code):
sudo sh /path/to/amd_proprietary_uninstall.sh
sudo apt-get remove --purge fglrx and related packages
Now let me give the specific actual commands.
Here are all the variants of the first command. Try them in order. When you get one that works, you are done and you can move on to the second command:
sudo sh /usr/share/ati/ati-uninstall.sh
sudo sh /usr/share/ati/amd-uninstall.sh
sudo sh /usr/share/ati/fglrx-uninstall.sh
sudo aticonfig --uninstall (NOTE: assumes the executable is in the path)
sudo sh ati-driver-installer-x86.x86_64.run --uninstall
As you probably see, the first 3 variants just involve changes to the script name that happened over time. You could simply do a listing of
/usr/share/ati/ and look for the correct file name rather than trying all 3 of those command variants.
The last two variants come from the official Catalyst Linux doc. These involve passing the
--uninstall parameter to another script. However, you still need to find the correct name of that script. There could be more variants than shown above, although these are the only two listed in the official Catalyst Linux doc.
If you get a response to any of the first command variants above like this:
failed: No such file or directory
then try the next variants. If you exhaust all the variants of the first command without anything executing, consider the job done.
Now, execute the second command. This form should cover all cases (thanks to the use of wildcards):
sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
Restore original config
The original Xorg configuration file was automatically restored for me by the above steps. However, the official Catalyst Linux doc gives the following manual steps:
- Locate backup configuration files: ls /etc/X11/xorg.conf.original-*
- Take the latest version with the highest number and copy it over the existing
xorg.conf file: cp /etc/X11/xorg.conf.original- /etc/X11/xorg.conf
Furthermore, I think it is important to read this link:
X/Troubleshooting/VideoDriverDetection - Ubuntu Wiki
This question is about removing fglrx, but you also want to be able to reboot your computer into a working configuration after removing fglrx. The link above gives several steps. I think they are probably too long to paste here since it is not directly related to the question. But I mention it because it is important to reinstall the original drivers. In short, the command will be similar to:
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
lts hardware enablement stack
Important: if you are running the lts hardware enablement stack, things may be a bit more difficult. I found a solution here:
It is in response to this question:
12.04 - Experiencing major issues on graphic displays - Ask Ubuntu
Experiencing major issues on graphic displays
See the link for full details.
Here are some related links:
Microsoft Word - Catalyst_Linux_Installer.doc - catalyst_linux_installer.pdf
BinaryDriverHowto/ATI - Community Ubuntu Documentation