can't remove nvidia-glx

Bug #36625 reported by Ariel Vardi
198
Affects Status Importance Assigned to Milestone
linux-restricted-modules-2.6.24 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

It's impossible to remove nvidia-glx once it's been installed.

Removing nvidia-glx ...
dpkg-divert: rename involves overwriting `/usr/lib/libGL.so.1.2' with
  different file `/usr/lib/nvidia/libGL.so.1.2.xlibmesa', not allowed
dpkg: error processing nvidia-glx (--remove):
 subprocess post-removal script returned error exit status 2
Errors were encountered while processing:
 nvidia-glx
E: Sub-process /usr/bin/dpkg returned an error code (1)

Why isn't the renaming allowed?

Revision history for this message
Ariel Vardi (ariel-vardi) wrote :

to fix the situation, the file /usr/lib/libGL.so.1.2 has to be manually erased. The package nvidia-glx can then be removed. To get the normal non-nvidia libGL file back, the package libgl1-mesa has to be reinstalled: apt-get install --reinstall libgl1-mesa.

Revision history for this message
Warren Woodford (warren-mepis) wrote :

FYI, purging nvidia-glx doesn't work when switching between nvidia-glx and nvidia-glx-legacy because both packages divert the same files. The postrm script should be modified in both packages to recognize when the other diversion is present and the remove should be bypassed.

Some good rules of thumb to apply when removing diverts in postrm scripts:
1. When multiple packages divert the same file, the postrms should skip the remove if the other divert is present. This can also happen if a package changes name.
2. In general removes should be tested before being applied in order to prevent deadlock situations.
3. Like in the report above, sometimes a file must be deleted manually before a divert remove will work.

To have a more polished distro, the postrms should anticipate and accommodate such situations.

Just my 2 cents.

Timo Aaltonen (tjaalton)
Changed in linux-restricted-modules-2.6.17:
status: New → Confirmed
Revision history for this message
Alberto Milone (albertomilone) wrote :

This patch should make sure that a diversion is removed only if there's no more than 1 diversion of the same file.

I don't know if it's exactly what Warren Woodford meant though.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-restricted-modules-2.6.24 - 2.6.24.9-8.20

---------------
linux-restricted-modules-2.6.24 (2.6.24.9-8.20) hardy; urgency=low

  [ Timo Aaltonen ]
  * nvidia-glx*:
    - When using the nvidia-settings binary for storing
      values in xorg.conf it clutters up the file with unneeded settings,
      and some are just plain wrong nowadays (the mouse device for
      instance). So, don't ship the version included in the drivers, instead
      Suggest nvidia-settings -package (again), and fix the issues there.
    - Don't ship nvidia-settings.desktop, only the .png file.
      Nvidia-settings will include the desktop-file.
  * rules:
    - Enable fglrx for -rt (LP: #182242)
  * rules, control.stub.in:
    - Enable -server flavor. (LP: #153011)
  * dvb:
    - Add dvb-usb-bluebird-01.fw (LP: #90723)
    - Add dvb-fe-tda10046.fw (LP: #107090)
  * ati: Update fglrx to 8-02. (LP: #173663, #189772)
  * {nvidia-glx,nvidia-glx-dev,xorg-driver-fglrx}.postrm.in
    - Check that the diverted file actually belongs to the current package
      before trying to remove the diversion. Thanks to Kirk Turner and
      Alberto Milone for patches, and Michael Vogt for review!
      (LP: #36625, #130208, #175789)
  * nvidia-glx.{preinst,postrm}.in, rules:
    - Fix the path of libglx.so.
  * rules:
    - Unexport CFLAGS and LDFLAGS to cope with the new dpkg-buildpackage.

  [ Alberto Milone ]
  * debian/lrm-video: Add support for EnvyNG.

 -- Timo Aaltonen <email address hidden> Thu, 14 Feb 2008 17:57:44 +0200

Changed in linux-restricted-modules-2.6.24:
status: Confirmed → Fix Released
Revision history for this message
Dexhu (dx4tech) wrote :

I need a patch or a Step by step process to remove bug!

Revision history for this message
Hans L (thehans) wrote :

I am still encountering the specific error mentioned in bug #184212, which has been marked as a duplicated of this bug.
The removal of the package fails on looking for /usr/lib3/libGL.so.1
Reopening

Changed in linux-restricted-modules-2.6.24:
status: Fix Released → New
Revision history for this message
Hans L (thehans) wrote :
Revision history for this message
Hans L (thehans) wrote :
Revision history for this message
Alberto Milone (albertomilone) wrote :

Peepsalot: can you attach your /var/lib/dpkg/info/nvidia-glx-new.postrm ?

Revision history for this message
Hans L (thehans) wrote :
Revision history for this message
Hans L (thehans) wrote :

I attached the file, just commenting because I'm not sure if sending the file alone sends updates.

Revision history for this message
Alberto Milone (albertomilone) wrote :

The attachment is, in my opinion (I'm not an Ubuntu developer), what your file should look like in order to prevent that problem from happening. I'm not sure as to whether this is the best solution.

Maybe you can:
1) make a backup of the original nvidia-glx-new.postrm (so that you can restore it if something goes wrong)
2) try to replace your /var/lib/dpkg/info/nvidia-glx-new.postrm with the one in the attachment
3) try to uninstall nvidia-glx-new again.

The attachment adds a "|| true" to each line which tries to remove a file so that if such file doesn't exist the script doesn't fail.

A full patch would involve applying the said corrections to the debian/nvidia-glx.postrm.in of the linux-restricted-modules.

Just my 2 cents

Revision history for this message
Rodrigo (hrodicus) wrote :

You might have a problem with "/usr/lib32/libGL.so.1.2" (notice is lib32 not lib)
open this file --> sudo gedit /var/lib/dpkg/info/nvidia-glx-new.postrm
I fixed this manually by adding comments before the lines that check existence of lib32 directory
At least you will have synaptic working again...

Revision history for this message
Peter de Kraker (peterdekraker) wrote :

I am having the same error here. This is not fixed in the official hardy release:
When running sudo apt-get remove --purge nvidia-glx-new it complains about: /usr/lib32/libGL.so.1 and won't continue.

I am using hardy 64 bit, and the /usr/lib32 directory doesn't even exist on my fresh 8.04-release install.
sudo apt-get install --reinstall nvidia-glx-new does work, but still the remove won't function.

Revision history for this message
Peter de Kraker (peterdekraker) wrote :

with Rodrigo's method I succeeded in removing it.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Peter, can you do a "diff -u" between the original postrm and yours and attach the output to the report.

Thanks,

Changed in linux-restricted-modules-2.6.24:
status: New → Confirmed
Revision history for this message
Peter de Kraker (peterdekraker) wrote :

I am not experiencing the problem anymore. I checked my current postrm and it is the same as the current original one, so it looks like it is solved.
So no "diff -u".

However, if you still have the old version and thus the problem:
The only thing I did was remove the "if [..] fi" part that checked for the lib32/libgl.so file. So that are 4 lines total.

Revision history for this message
jldr (jldr) wrote : Re: [Bug 36625] Re: can't remove nvidia-glx

Hello
thank's this bug is closed now for me
Jean-Luc
----- Message d'origine -----
De: Jean-Baptiste Lallement <email address hidden>
Date: Sun, 04 May 2008 22:04:32 -0000
Sujet: [Bug 36625] Re: can't remove nvidia-glx
À: <email address hidden>

>Peter, can you do a "diff -u" between the original postrm and yours and
>attach the output to the report.
>
>Thanks,
>
>** Changed in: linux-restricted-modules-2.6.24 (Ubuntu)
> Status: New => Confirmed
>
>--
>can't remove nvidia-glx
>https://bugs.launchpad.net/bugs/36625
>You received this bug notification because you are a direct subscriber
>of the bug.
>

Revision history for this message
jldr (jldr) wrote :

Hello
Thank's this bug is closed now for me
Jean-Luc
----- Message d'origine -----
De: Peter de Kraker <email address hidden>
Date: Sun, 04 May 2008 23:29:49 -0000
Sujet: [Bug 36625] Re: can't remove nvidia-glx
À: <email address hidden>

>I am not experiencing the problem anymore. I checked my current postrm and it is the same as the current original one, so it looks like it is solved.
>So no "diff -u".
>
>However, if you still have the old version and thus the problem:
>The only thing I did was remove the "if [..] fi" part that checked for the lib32/libgl.so file. So that are 4 lines total.
>
>--
>can't remove nvidia-glx
>https://bugs.launchpad.net/bugs/36625
>You received this bug notification because you are a direct subscriber
>of the bug.
>

Revision history for this message
PieterIserbyt (pieter-iserbyt) wrote :

Didn't read this bug, already fix it. I solved it differently than rodrigo: created a symbolic link "/usr/lib32" that points to "/usr/lib" so the removal script that assumes 32-bit only will work.

Issuing these commands should take care of the problem:

sudo ln -s /usr/lib /usr/lib32
sudo aptitude remove nvidia-glx
sudo rm /usr/lib32

Revision history for this message
nanog (sorenimpey) wrote :

This bug was not fixed for me on a brand new install 7-3-08.

A forum post confirms that this bug was not fixed three weeks ago:

http://ph.ubuntuforums.com/showthread.php?t=825029

The solution in the forum post worked:

sudo mkdir /usr/lib32
sudo touch /usr/lib32/libGL.so.1

Revision history for this message
Caroline Ford (secretlondon) wrote :

I have this problem on AMD64 hardy - trying to replace nvidia-glx-new with envy.

I suspect the uninstall script is having problems with 64 bit libs.

Revision history for this message
Caroline Ford (secretlondon) wrote :

Creating an empty file as above does work, but presumably the script should be removing libGL.so.1 from somewhere else. Giving it a blank file with the correct name in the wanted location doesn't mean it's uninstalled properly.

Revision history for this message
dlotton (yellow56) wrote :

Similar problem here with Kubuntu 8.04.1 AMD64 on 9/11/2008.

After a lot of gnashing of teeth I got it working... essentially same fix as nanog above, except all I did was create the '/usr/lib' directory. I didn't have to create (touch) the libGL.so.1 file.

sudo mkdir /usr/lib32

After that I was able to uninstall/install nvidia-glx and other nvidia packages without problems.

Revision history for this message
Bryce Harrington (bryce) wrote : linux-restricted-modules-2.6.24 is obsolete

Thank you for reporting this issue about a driver from the
linux-restricted-modules package. lrm-2.4.24 was shipped with Ubuntu
8.04 which reached end-of-life for desktop support on May 12th, 2011.

For that reason, this bug report is being closed at this time. I'm
marking it wontfix because what you describe is probably a valid issue,
but there are no plans to work on lrm 2.4.24 bugs further.

The issue may be resolved in a newer version. If not, aside from filing
a new bug report, another angle may be to file it directly with the
driver vendor.

Changed in linux-restricted-modules-2.6.24 (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Samuel Creshal (samuel-creshal) wrote :

Now that's a quick response.

OR NOT.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.