Ubuntu version: 18.04
Apt version: 1.6.13
I attempted to install a different cuda toolkit, and in doing so may have irrevocably broken apt. I believe the problem has nothing to do with cuda however, and that apt is at fault here.
If I run sudo apt-get install *anything*
(or apt remove or apt purge) I get the error:
Reading package lists... Done Building dependency tree Reading state information... Done cuda is already the newest version (11.2.2-1). You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies. cuda-drivers-460 : Depends: libnvidia-common-460 (>= 460.32.03) but it is not going to be installed libnvidia-gl-460 : Depends: libnvidia-common-460 but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
so I try sudo apt --fix-broken install
:
Get:1 file:/var/cuda-repo-ubuntu1804-11-2-local libnvidia-common-460 460.32.03-0ubuntu1 [10.2 kB] Err:1 file:/var/cuda-repo-ubuntu1804-11-2-local libnvidia-common-460 460.32.03-0ubuntu1 File not found - /var/cuda-repo-ubuntu1804-11-2-local/./libnvidia-common-460_460.32.03-0ubuntu1_all.deb (2: No such file or directory) E: Failed to fetch file:/var/cuda-repo-ubuntu1804-11-2-local/./libnvidia-common-460_460.32.03-0ubuntu1_all.deb File not found - /var/cuda-repo-ubuntu1804-11-2-local/./libnvidia-common-460_460.32.03-0ubuntu1_all.deb (2: No such file or directory) E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
indeed /var/cuda-repo-ubuntu1804-11-2-local
does not exist, let alone the files within.
Running sudo apt-get update
yields:
E: The repository 'file:/var/cuda-repo-10-1-local-10.1.105-418.39 Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'file:/var/cuda-repo-ubuntu1804-11-2-local Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
which again probably stems from not having /var/cuda-repo-ubuntu1804-11-2-local
(or /var/cuda-repo-10-1-local-10.1.105-418.39
)
following the advice from https://forums.linuxmint.com/viewtopic.php?t=281922
I have also tried:
sudo su for FILE in $(dpkg-divert --list | grep nvidia-440 | awk '{print $3}'); do dpkg-divert --remove $FILE; done exit
but entering the line beginning for FILE...
does nothing (nor does replacing nvidia-440
with 450 or 460)
I am using apt version 1.6.13 which I have tried reinstalling by running sudo dpkg -i apt_1.6.13_amd64.deb
(downloaded from http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.13_amd64.deb
) but I still get the same errors when running anything above
any suggestions would be greatly appreciated - I would really like to avoid having to reinstall ubuntu.