-1
sudo apt install nvidia-driver-535
The following packages have unmet dependencies:
 nvidia-driver-535 : Depends: libnvidia-compute-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-extra-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-decode-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-encode-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: xserver-xorg-video-nvidia-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-cfg1-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-fbc1-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Recommends: nvidia-settings but it is not going to be installed
                     Recommends: nvidia-prime (>= 0.8) but it is not going to be installed
                     Recommends: libnvidia-compute-535:i386 (= 535.104.12-0ubuntu1)
                     Recommends: libnvidia-decode-535:i386 (= 535.104.12-0ubuntu1)
                     Recommends: libnvidia-encode-535:i386 (= 535.104.12-0ubuntu1)
                     Recommends: libnvidia-fbc1-535:i386 (= 535.104.12-0ubuntu1)
E: Unable to correct problems, you have held broken packages.```
karel
  • 114,770

3 Answers3

1

Before the update, you need to clear old nvidia file from your system, which requires a reboot. Then, force-install the packages needed. Finally, install the driver as intended.

Run these with sudo, not as root!

1. Purge nvidia-*

sudo apt purge nvidia-*
sudo apt update
sudo reboot

2. Force install dependencies and fix

sudo apt install -y libnvidia-fbc1-535 libnvidia-cfg1-535 xserver-xorg-video-nvidia-535 libnvidia-encode-535 libnvidia-decode-535 libnvidia-extra-535 libnvidia-compute-535
sudo apt --fix-broken install

3. Install driver

sudo apt install -y nvidia-driver-535

Reboot one last time, and you should be golden.

Artur Meinild
  • 26,018
No-one
  • 274
1

You first must purge existing nvidia driver. lets say you have nvidia-driver-470

  1. Run sudo apt purge nvidia-driver-470. You also need to purge all nvidia stuff related to that driver 470
  2. Install dkms using apt
  3. Run sudo apt update
  4. Restart your PC
  5. Run sudo apt install nvidia-driver-535

Ask me more if you still have any problems!

  • 1
    This is a good first step, and will probably solve the problem for anyone who hasn't already messed up their cache trying other solutions. Didn't work for me though. – Tony Chiboucas Oct 05 '23 at 06:41
0

Improving @noone answer above, this worked for me:

  1. Purge nvidia-*

    sudo apt purge nvidia-*
    sudo apt update
    sudo reboot
    
  2. Install the exact required version:

    sudo apt libnvidia-compute-535=535.104.12-0ubuntu1
    
  3. Force install dependencies and fix

    sudo apt install -y libnvidia-fbc1-535 libnvidia-cfg1-535 xserver-xorg-video-nvidia-535 libnvidia-encode-535 libnvidia-decode-535 libnvidia-extra-535 libnvidia-compute-535
    sudo apt --fix-broken install
    
  4. Install driver

    sudo apt install -y nvidia-driver-535
    

Edit: If the error persists due to dependencies keep installing the specific versions for each package until you have success. gdebi will list them on by one, always printing the first unmet dependency. apt will print all, so you have to be carefull to install all of the dependencies (almost 10).