Unable to install podman in Ubuntu 20.04 running on WSL2 in Windows 10
I cannot install podman following the official RedHat instructions or any other, for instance.
I always get to the same situation
diegosasw@LAP-DMARTIN:~$ sudo apt-get -qq -y install podman
E: Unable to correct problems, you have held broken packages.
diegosasw@LAP-DMARTIN:~$ sudo apt-get -y install podman
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: podman : Depends: containers-common (>= 1.2.0~3) but it is not going to be installed Recommends: crun but it is not going to be installed Recommends: slirp4netns but it is not going to be installed Recommends: uidmap but it is not going to be installed Recommends: varlink but it is not going to be installed
E: Unable to correct problems, you have held broken packages.I have tried upgrading sudo apt-get upgrade and everything is up to date. Same problem. If anything I can see containers-common 1.2.0~2 installed, but never the 1.2.0.~3 (assuming that's the reason of the broken packages).
Does anybody know the cause? It is a brand new Ubuntu 20.04 distro and these are the steps followed on first run as per
. /etc/os-release
sudo sh -c "echo 'deb /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
curl -L | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get -qq -y install podmanAnd I have the following:
diegosasw@LAP-DMARTIN:~$ ls /etc/apt/sources.list.d
devel:kubic:libcontainers:stable.list 4 1 Answer
Older question that got bumped recently, but for anyone wondering, as of the time of this answer, the instructions on podman.io currently work for Ubuntu on WSL2.
There are two options:
First, if you update your WSL2 Ubuntu installation to 21.10 per my answer here, you can simply:
sudo apt-get -y update sudo apt-get -y install podmanIf you prefer installing on WSL2 Ubuntu 20.04 (LTS), the normal directions on podman.io also apply, with some minor tweaks.
First (but not mentioned in the podman doc), make sure your current distro is up to date before attempting to install the podman repo key. Otherwise you may run into an expired certificate chain:
sudo apt update && sudo apt upgrade -yRun the commands in the podman doc. Currently, this is:
. /etc/os-release echo "deb /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list curl -L "" | sudo apt-key add - sudo apt-get update sudo apt-get -y upgrade sudo apt-get -y install podmanHowever, please refer to the doc for the most recent information.
Also not mentioned in the podman doc, but you might want to add:
sudo apt install buildahThis package is included as a dependency for the 21.10
podmanpackage, but you'll need to add it manually on 20.04.