On Ubuntu 20.04, and trying to install ROS2 Galactic, requires the following package:
sudo apt install -y libpython3-dev
However, this returns the following:
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 resolve the situation: The following packages have unmet dependencies: libpython3-dev : Depends: libpython3.8-dev (>= 3.8.2-1~) but it is not going to be installed E: Unable to correct problems, you have held broken packages
I tried installing
libpython3.8-dev , which returns an unmet dependency of
The following packages have unmet dependencies: libpython3.8-dev : Depends: libexpat1-dev but it is not going to be installed Recommends: libc6-dev but it is not going to be installed or libc-dev
This chain continues for a while.
Eventually leads to:
libc6-dev : Depends: libc6 (= 2.31-0ubuntu9) but 2.31-0ubuntu9.2 is to be installed
libc6 is already the newest version (2.31-0ubuntu9.2).
I have tried:
- sudo apt autoremove
- Main, universe and multiverse are all selected as PPAs
- sudo dpkg --configure -a
- sudo apt-get -f install
- sudo apt-get autoclean
- sudo apt-get -u dist-upgrade
Seems to me like apt is broken, its a relatively new install of Ubuntu 20.04, so not sure why. I've had similar broken apt problems, and I ended up just reinstalling Ubuntu to save time. But I want to figure out the problem this time. Any help is appreciated.
sudo apt update
Hit:1 https://brave-browser-apt-release.s3.brave.com stable InRelease Hit:2 http://ca.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://archive.canonical.com/ubuntu focal InRelease
Hit:5 http://packages.ros.org/ros2/ubuntu focal InRelease Reading package lists... Done Building dependency tree
Reading state information... Done All packages are up to date.