On Ubuntu 8.04 “Hardy”, the ATI Catalyst 8.4 Driver .deb packages for amd64 will build from the ATI download, but one of the four packages, xorg-driver-fglrx_8.476, will not install out of the box when you try to install the packages in the usual way.
The problem is an error in the preinstall script for the package. In a Debian package, one of the things that a package script sometimes does is “divert” files. The idea is that a package can specify that any attempt by a future package to install a file having a particular name is to be handled by renaming the file to something else, or diverting it. In this way, a package can protect files from being overwritten without causing another package to fail to install. If you have customised a package-supplied file, which might be overwritten by a package upgrade, you can use dpkg-divert to protect your version.
The ATI xorg driver package uses this facility to stop MesaGL, a software Open GL renderer, from overwriting the ATI hardware drivers. That's a good thing, but the problem is that the preinstall script diverts two files to the same target. In other words, it says “instead of installing /foo/bar, rename it /foo/quux” then a second later, “instead of installing /foo/baz, rename it /foo/quux as well”. That's not allowed (because it's obviously stupid).
This accounts for the seemingly bizarre error-message that xorg-driver-fglrx_8.476 is trying to divert to a file target that it, itself, has already diverted another file to!
I suspect that the person who wrote the script copy'n'pasted the line, remembered to edit the filename to divert, but forgot to change where it was diverted to. An easy, if silly, mistake to make. ATI have made a lot of progress in providing decent Linux driver, maybe we shouldn't be too hard on them for lousy QA.
The fix follows below the fold…
IF THIS BREAKS, YOU GET TO KEEP BOTH PARTS
In principle, the fix is very easy:
- Unpackage the .deb archive.
- Edit the preinst script to fix the error.
- Repackage the .deb archive.
In practice, it's a little tricky to do manually, so I've provided a shell script to help make it easier: fix-cat84.sh.
It seems that the postrm script is similarly "challenged", but I didn't know this until Chris (below) brought it to my attention. I've done the best I can to fix the postrm script too (it's straightforward), but I would have to remove the existing package, install the new one, and then remove it in order to test the new postrm script, and that's a bit too much like hard work, so I haven't tested it. When an update to the driver appears, I'm going to have a problem removing the old package and I'll post my solution when that happens.
If you decide to go ahead, here's the instructions:
- Build the packages, but don't install them.
- Create a new empty directory.
- Copy the script into the directory and make it executable.
- Copy the xorg-driver-fglrx_8.476-0ubuntu1_amd64.deb package into the directory.
- From the shell-prompt, cd into the new directory and run the script.
For example (if you like to live a little dangerously):
$ mkdir tmp $ cd tmp $ wget http://www2.ati.com/drivers/linux/ati-driver-installer-8-4-x86.x86_64.run $ sh ati-driver-installer-8-4-x86.x86_64.run --buildpkg Ubuntu/hardy $ wget http://caulfield.info/emmet/src/fix-cat84.sh $ sh fix-cat84.sh
You should now be able to install the packages in the usual way.