1

Specifically, when trying to install freeglut3-dev, I get an error of broken dependencies. I already tried with the classic: fixing the packages and different methods that I found, but nothing is fixing this error. My system is Ubuntu 18.04

sudo apt-get update --fix-missing
sudo dpkg --configure -a
sudo apt-get install -f
sudo apt upgrade

The error When installing:

sudo apt-get install freeglut3-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies: freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed or libgl-dev Depends: libglu1-mesa-dev but it is not going to be installed or libglu-dev E: Unable to correct problems, you have held broken packages.

Previous to this, I was having a lot of issues with nvidia, cuda and cudnn, so if I recall properly, I think I added some local repos (added ppas, but not sure) from a university in China . To install some versions of CUDA, those versions worked for Ubuntu 16.04, so this might be making the error. When doing apt update, I don't recall seeing before the format of GET IGN of a file like

Get:1 file:/var/cuda-repo-ubuntu1804-11-6-local  InRelease
Ign:1 file:/var/cuda-repo-ubuntu1804-11-6-local  InRelease

But I really am very lost and have been working around this for some time. If my guess is right, deleting those should fix this. But I am not sure if that's the correct answer, or even how to do it.

sudo apt update
Get:1 file:/var/cuda-repo-ubuntu1804-11-6-local  InRelease
Ign:1 file:/var/cuda-repo-ubuntu1804-11-6-local  InRelease
Get:2 file:/var/cudnn-local-repo-ubuntu1804-8.4.0.27  InRelease
Ign:2 file:/var/cudnn-local-repo-ubuntu1804-8.4.0.27  InRelease
Get:3 file:/var/cuda-repo-ubuntu1804-11-6-local  Release [564 B]
Get:4 file:/var/cudnn-local-repo-ubuntu1804-8.4.0.27  Release [564 B]
Get:3 file:/var/cuda-repo-ubuntu1804-11-6-local  Release [564 B]
Get:4 file:/var/cudnn-local-repo-ubuntu1804-8.4.0.27  Release [564 B]
Hit:5 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  InRelease
Hit:6 https://download.docker.com/linux/ubuntu bionic InRelease                                                    
Hit:7 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  InRelease                        
Hit:8 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  InRelease                                          
Hit:9 https://linux.teamviewer.com/deb stable InRelease                                                            
Hit:11 http://es.archive.ubuntu.com/ubuntu bionic InRelease                                                        
Hit:12 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease                                             
Hit:13 http://es.archive.ubuntu.com/ubuntu bionic-backports InRelease                                              
Hit:14 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease                                       
Hit:15 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                 
Hit:17 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic InRelease                                 
Hit:18 https://packagecloud.io/AtomEditor/atom/any any InRelease                                              
Reading package lists... Done 
Building dependency tree       
Reading state information... Done
All packages are up to date.

Edit: I just checked my history browser to make sure about the adding repos, and I think it was just for conda, not particularly for ubuntu but again, I am not sure if it has any impact. Not an Ubuntu expert:

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/

Maybe when I tried this sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev and

wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run

Edit 2: Output of

grep -Rn --include=*.list ^[^#] /etc/apt/

/etc/apt/sources.list:5:deb http://es.archive.ubuntu.com/ubuntu/ bionic main restricted
/etc/apt/sources.list:15:deb http://es.archive.ubuntu.com/ubuntu/ bionic universe
/etc/apt/sources.list:24:deb http://es.archive.ubuntu.com/ubuntu/ bionic multiverse
/etc/apt/sources.list:33:deb http://es.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list:43:deb http://security.ubuntu.com/ubuntu bionic-security main restricted
/etc/apt/sources.list:45:deb http://security.ubuntu.com/ubuntu bionic-security universe
/etc/apt/sources.list:47:deb http://security.ubuntu.com/ubuntu bionic-security multiverse
/etc/apt/sources.list:49:deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main
/etc/apt/sources.list:51:deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
/etc/apt/sources.list.d/cuda-ubuntu1804-11-6-local.list:1:deb file:///var/cuda-repo-ubuntu1804-11-6-local /
/etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-bionic.list:1:deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic main
/etc/apt/sources.list.d/nvidia-docker.list:1:deb https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) /
/etc/apt/sources.list.d/nvidia-docker.list:3:deb https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/$(ARCH) /
/etc/apt/sources.list.d/nvidia-docker.list:5:deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/$(ARCH) /
/etc/apt/sources.list.d/cudnn-local-ubuntu1804-8.4.0.27.list:1:deb file:///var/cudnn-local-repo-ubuntu1804-8.4.0.27 /
/etc/apt/sources.list.d/teamviewer.list:19:deb https://linux.teamviewer.com/deb stable main
/etc/apt/sources.list.d/obsproject-ubuntu-obs-studio-bionic.list:1:deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic main
/etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-bionic.list:1:deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
M.K
  • 117
  • Having repos in /var seems very unusual. – Organic Marble May 08 '22 at 17:20
  • Yes! That was my thought! I am not a Linux expert, so I might have done something wrong at some point (probably when trying so hard to install in different ways cuda, cudnn and tensorflow). But I am not exactly sure if I should remove those, or how to exactly remove them (might affect negatively?) if they are in var @OrganicMarble – M.K May 08 '22 at 17:23
  • 2
    You also have a lot of PPAs and other sources. Outdated and unnecessary PPAs and sources have a tendency of wrecking your package management. In particular, I see the PPA for OBS which is unnecessary because OBS is already in repositories. The same is true for docker. Most concerning is the deadsnakes PPA which suggests that you've installed a different version of python which will absolutely break your system. Adding sources is a very messy and often catastrophic way to add new software. See: Are PPAs safe... – Nmath May 08 '22 at 18:58
  • I see, I messed it up somehow. Is there a way to delete these in a safe way? Should I just reset my system as default? (Would be a pain but I guess I can do it). @Nmath – M.K May 08 '22 at 19:22
  • 2
    It depends. If you have well organized backups then it doesn't take much time or effort to spin up and set up a new system. So you will find many people will do that instead of finding and fixing problems individually. Alternatively, you can remove all the software installed by PPA, remove the PPAs and then reinstall the software you need from repos or snap. However if you did install a different python version on your system, I would reinstall the system- that's a very messy mistake. Use an environment if you need to use a different python version in the future – Nmath May 08 '22 at 19:34
  • I will see if I can fix it for a bit more time but seeing my luck, I think removing the partition and installing a new one will be better. Thank you for the advice. I will now be more careful with what I install and add (specially python versions) @Nmath – M.K May 08 '22 at 20:12

0 Answers0