I am not able to install anything in ubuntu

Okay, to back out of this, run the following commands:

sudo rm /etc/apt/sources.list.d/cuda.list
sudo apt-get clean
sudo apt-get update
sudo apt install -f

This will uninstall the nvidia repo you downloaded and installed and hopefully the system will fix itself now. If not, we can fix it manually fairly easily by following the error messages.

You may need to do some more purging and we may have to use dpkg to do that manually so please post any more errors. Thanks!


In my case, removing packages causing collision solved the problem.

dpkg -P nvidia-cuda-toolkit nvidia-cuda-dev
apt --fix-broken install

I had to comment out the following line in the file /etc/apt/sources.list

deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /

and then run

sudo apt --fix-broken install

That resolved the broken package manager problem created by trying to install CUDA Toolkit 10.2 Download on Ubuntu 18.04 by following Nvidia instructions