1

I have a Dell with a Core I5 and a GeForce820M.

After upgrading to 18.04 LTS I tried to upgrade the nvidia drivers by running

sudo apt-get install nvidia-340

which is the recommended driver for my GPU.

The problem is the installation failed, I didn't record the fail reasons and now any dpkg or apt-get commands I try to run say that I should run

sudo dpkg --configure -a 

I tried running that but it kept getting stuck at

Building initial module for 4.15.0-23-generic

Finally I managed to complete it, but when I tried to install the nvidia-340 package again I got an error:

Preparing to unpack .../nvidia-340_340.106-0ubuntu3_amd64.deb ...
Adding '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: rename involves overwriting '/usr/lib/x86_64-linux-gnu/libGL.so.1.distrib' with
  different file '/usr/lib/x86_64-linux-gnu/libGL.so.1', not allowed
dpkg: error processing archive /var/cache/apt/archives/nvidia-340_340.106-0ubuntu3_amd64.deb (--unpack):
 new nvidia-340 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-340_340.106-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

marked as duplicate by karel, Eric Carvalho, Fabby, Zanna, Thomas Dec 16 '18 at 10:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Had the exact same hang onthe exact same kernel while trying to install nvidia-390. Following this thread it seems like the install is waiting for a password, so I blind-typed it several times and the installation continued.

You should probably purge the package you installed and try to re-install it. Installing as root user would eliminate the need to type the password.

Not the answer you're looking for? Browse other questions tagged or ask your own question.