package libnvidia-gl-390 (not installed) failed to install/upgrade: new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2 (NOT FIXED)

Bug #1768050 reported by NinePillars
102
This bug affects 23 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-390 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

There is a previous report, but I don't think this bug has been fixed, it is still there.

When I execute "sudo ubuntu-drivers autoinstall"

the driver does not installed. then I was told:

"diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package"

then I trace the bug and found it may be comes from libnvidia-gl-390 package and libnvidia-ifr1-390.

and When I try to install only the libnvidia-gl-390 package, I've got:

package libnvidia-gl-390 (not installed) failed to install/upgrade: new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers-390 (Ubuntu):
status: New → Confirmed
Revision history for this message
Van Stokes, Jr. (vstokes) wrote :

root@eerlon:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
The following NEW packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/29.1 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 153905 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-390'
  found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):
 new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-390'
  found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb (--unpack):
 new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@eerlon:~#

description: updated
description: updated
description: updated
Revision history for this message
Alexandre Lima (antuneslimarj) wrote :

I had the same problem and I solved with this solution:

As rootm run:

# for FILE in $(dpkg-divert --list | grep nvidia-340 | awk '{print $3}'); do dpkg-divert --remove $FILE; done

Then:

# apt --fix-broken install

Font: https://askubuntu.com/questions/1035409/installing-nvidia-drivers-on-18-04

Best Regards!

I (farail)
Changed in nvidia-graphics-drivers-390 (Ubuntu):
assignee: nobody → I (farail)
assignee: I (farail) → nobody
Revision history for this message
Kasper Svendsen (svendsen-kasper) wrote :

Hi,
I also have this issue. But have not been able to solve it..
Is a newbie, so please forgive me if I do not provide all info first hand :)
Also I do not know where else to ask for help...

Have done as suggested, but still same issue. just I use nvidia-340.
Using:
Kubuntu 18.04 LTS
Dell E6410
suggested driver Nvidia-340 (default driver do not work with external monitor HDMI any more :( ).

The story. what have I done:
It started with the bug in Ubuntu 18.04 GL dispatch library.
I followed guides om the net and did:
sudo dpkg -P nvidia-340
sudo apt --fix-broken install
sudo apt remove nvidia-340
sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade
sudo apt autoremove

The update Finished OK

Then I tried to install new nvidia-340 as guided in https://askubuntu.com/questions/1077493/unable-to-install-nvidia-drivers-on-ubuntu-18-04
(adding ppa:graphics-drivers/ppa).
Did not work so removed PPA again and sudo dpkg -P nvidia-340

Later the new 340.107 driver was released in official PPA and I tried installing again..
Still the issue. I can not get the nvidia-340 drivers installed..

Get this failure (sorry I am Danish hope you can see the point any way):
Gør klar til at udpakke .../nvidia-340_340.107-0ubuntu0.18.04.1_amd64.deb ...
Tilføjer 'omdirigeret af /usr/lib/x86_64-linux-gnu/libGL.so.1 til /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib gennem nvidia-340'
dpkg-divert: fejl: omdøbning medfører overskrivning af '/usr/lib/x86_64-linux-gnu/libGL.so.1.distrib' med
  anden fil `/usr/lib/x86_64-linux-gnu/libGL.so.1', ikke tilladt
dpkg: fejl under behandling af arkivet /var/cache/apt/archives/nvidia-340_340.107-0ubuntu0.18.04.1_amd64.deb (--unpack):
 new nvidia-340 package pre-installation script subprocess returned error exit status 2
Der opstod fejl under behandlingen:
 /var/cache/apt/archives/nvidia-340_340.107-0ubuntu0.18.04.1_amd64.deb

So I tried your suggestions.. Not working for Me.

I see there have been some reports recently, but no one seems to take action..
(I have not done this) https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1797791

https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/+bug/1792790

https://bugs.launchpad.net/ubuntu/+source/libglvnd/+bug/1728352

Please suggest what I can do to get my nvidia drivers back :)

Thanks in advance
Br.

Revision history for this message
Yuri Gor (yuri-horus) wrote :

Alexandre Lima's suggestion works, but it needs to be adjusted in case of not an English locale.

Try

# for FILE in $(dpkg-divert --list | grep nvidia-340 | awk '{print $3}'); do echo $FILE; done

first and choose the correct number for substring `{print $3}`

For example for Russian locale it will be $2:

# for FILE in $(dpkg-divert --list | grep nvidia-340 | awk '{print $2}'); do dpkg-divert --remove $FILE; done

Revision history for this message
Kasper Svendsen (svendsen-kasper) wrote :

Hi,
How do i find the right locale $x for DK ?

I cannot find $x no. Have looked:
https://unix.stackexchange.com/questions/111542/what-is-awk-print-10-45-2-3-file1-file2
https://www.shellhacks.com/linux-define-locale-language-settings/

output of $ "locale" is:
LANG=da_DK.UTF-8
LANGUAGE=
LC_CTYPE="da_DK.UTF-8"
LC_NUMERIC="da_DK.UTF-8"
LC_TIME="da_DK.UTF-8"
LC_COLLATE="da_DK.UTF-8"
LC_MONETARY="da_DK.UTF-8"
LC_MESSAGES="da_DK.UTF-8"
LC_PAPER="da_DK.UTF-8"
LC_NAME="da_DK.UTF-8"
LC_ADDRESS="da_DK.UTF-8"
LC_TELEPHONE="da_DK.UTF-8"
LC_MEASUREMENT="da_DK.UTF-8"
LC_IDENTIFICATION="da_DK.UTF-8"
LC_ALL=

Thanks for helping. I am really missing my nvidia drivers.

br.

Revision history for this message
Kasper Svendsen (svendsen-kasper) wrote :

Hi,
I can not get this to work..
The Bug must still be there.

Please help or point Me to the right place to get some help on this.
I need to gat nvidia driver to work and be able to use a external monitor :)

Thanks in advance

br.

Revision history for this message
Moreau Julien (moreau-juli1) wrote :

This happened to me when I upgraded from 20.04 to 22.04
I have had to do this manually as I don't think any of the command lines are correct above. I actually lost my graphic interface in the process.
So at black screen I started a new TTY (Ctr alt F2)
I have gone to the folder
/var/lib/dpkg
I copied the diversions-old to a diversion_old.old
Then the diversions to diversions-old
Here was my diversions file:

/usr/lib/x86_64-linux-gnu/libEGL.so
/usr/lib/x86_64-linux-gnu/libEGL.so.distrib
nvidia-340
/usr/share/dict/words
/usr/share/dict/words.pre-dictionaries-common
dictionaries-common
/usr/lib/i386-linux-gnu/libGLESv2.so.2
/usr/lib/i386-linux-gnu/libGLESv2.so.2.distrib
nvidia-340
/usr/lib/x86_64-linux-gnu/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/libGLESv2.so.2.distrib
nvidia-340
/usr/lib/i386-linux-gnu/libGLESv1_CM.so.1
/usr/lib/i386-linux-gnu/libGLESv1_CM.so.1.distrib
nvidia-340
/usr/bin/pg_config
/usr/bin/pg_config.libpq-dev
postgresql-common
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.distrib
nvidia-340
/usr/share/vim/vim82/doc/help.txt
/usr/share/vim/vim82/doc/help.txt.vim-tiny
vim-runtime
/usr/lib/x86_64-linux-gnu/libEGL.so.1
/usr/lib/x86_64-linux-gnu/libEGL.so.1.distrib
nvidia-340
/usr/share/man/man1/sh.1.gz
/usr/share/man/man1/sh.distrib.1.gz
dash
/usr/lib/i386-linux-gnu/libGLESv2.so
/usr/lib/i386-linux-gnu/libGLESv2.so.distrib
nvidia-340
/usr/lib/i386-linux-gnu/libEGL.so
/usr/lib/i386-linux-gnu/libEGL.so.distrib
nvidia-340
/usr/share/vim/vim82/doc/tags
/usr/share/vim/vim82/doc/tags.vim-tiny
vim-runtime
/usr/lib/i386-linux-gnu/libGL.so
/usr/lib/i386-linux-gnu/libGL.so.distrib
nvidia-340
/usr/lib/x86_64-linux-gnu/libGL.so.1
/usr/lib/x86_64-linux-gnu/libGL.so.1.distrib
nvidia-340
/usr/lib/x86_64-linux-gnu/libGL.so
/usr/lib/x86_64-linux-gnu/libGL.so.distrib
nvidia-340
/usr/lib/i386-linux-gnu/libGLESv1_CM.so
/usr/lib/i386-linux-gnu/libGLESv1_CM.so.distrib
nvidia-340
/usr/share/aisleriot/cards/bonded.svg
/usr/share/aisleriot/cards/bonded.svg.unbranded
branding-ubuntu
/usr/lib/i386-linux-gnu/libEGL.so.1
/usr/lib/i386-linux-gnu/libEGL.so.1.distrib
nvidia-340
/usr/share/gnome-mahjongg/themes/postmodern.svg
/usr/share/gnome-mahjongg/themes/postmodern.svg.unbranded
branding-ubuntu
/bin/sh
/bin/sh.distrib
dash
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1
/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1.distrib
nvidia-340
/usr/share/aisleriot/pixmaps/baize.png
/usr/share/aisleriot/pixmaps/baize.png.unbranded
branding-ubuntu
/usr/share/aisleriot/pixmaps/slot.svg
/usr/share/aisleriot/pixmaps/slot.svg.unbranded
branding-ubuntu
/usr/lib/x86_64-linux-gnu/libGLESv2.so
/usr/lib/x86_64-linux-gnu/libGLESv2.so.distrib
nvidia-340
/usr/lib/i386-linux-gnu/libGL.so.1
/usr/lib/i386-linux-gnu/libGL.so.1.distrib
nvidia-340

I basically removed all the diversions for nvidia 340 (they are by groups of 3 lines)
Then

apt --fix-broken install

Now it works

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.