Installing podman 5+ on ubuntu older versions #25582
Replies: 3 comments 2 replies
-
Instructions were updated to do pinning more sanely. If you go to upgrade your server this method could prove to be a headache if you forget you did this, maybe add something to your MOTD to remind you of this customization would help in the future. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for providing this, helped me a lot to get podman 5.x on my Ubuntu 24.04 server, so I could finally use pod quadlets!! But I found a small typo, I guess it should be /etc/apt/preferences.d/podman, right? |
Beta Was this translation helpful? Give feedback.
-
In case anyone wants a one-click solution for this, I created a bash-script #!/bin/bash
# Must be run as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (e.g., sudo $0)"
exit 1
fi
# Define file paths
PINNING_FILE="/etc/apt/preferences.d/podman-plucky.pref"
SOURCE_LIST="/etc/apt/sources.list.d/plucky.list"
# Write Plucky APT source list
echo "Adding Plucky repo to $SOURCE_LIST..."
echo "deb http://archive.ubuntu.com/ubuntu plucky main universe" > "$SOURCE_LIST"
# Write APT pinning rules
echo "Writing APT pinning rules to $PINNING_FILE..."
cat <<EOF > "$PINNING_FILE"
Package: podman buildah golang-github-containers-common crun libgpgme11t64 libgpg-error0 golang-github-containers-image catatonit conmon containers-storage
Pin: release n=plucky
Pin-Priority: 991
Package: libsubid4 netavark passt aardvark-dns containernetworking-plugins libslirp0 slirp4netns
Pin: release n=plucky
Pin-Priority: 991
Package: *
Pin: release n=plucky
Pin-Priority: 400
EOF
# Update APT cache
echo "Updating APT package list..."
apt update
echo "Plucky pinning setup complete." In case, you want to remove this, all you need to do is delete those 2 created files, no need to modify the ubuntu.sources file. Thanks again for showing this solution, without that I could not use pod quadlets in Ubuntu 24.04 :) |
Beta Was this translation helpful? Give feedback.
-
Podman 5 was released in Springish of 2024. My original comments here were ignorant of the release timings between Ubuntu/Podman, and I edited this post to be a usable solution instead of complaining:
Modern packages of Podman (version 5.3+) are included in a new build of Ubuntu 25.04 codename plucky. To get these packages but keep an LTS for the rest of the system you can do some apt tricks, specifically pinning.
Please note this can be dangerous if you aren't careful and don't know what you're doing.
My original system is 24.04 Ubuntu codenamed noble.
Your original ubuntu sources file looks something like this, I added
plucky
to the Suites./etc/apt/sources.list.d/ubuntu.sources
:To pin packages for podman it's dependencies and related stuff place this file:
/etc/apt/preferences.d/podman.pref
This will allow you to install updated podman but keep packages for everything else pinned to the noble suite until you're ready to upgrade. In my case the cloud provider only has 24.04 ubuntu images/tooling available.
Check your work
apt update
apt-cache policy podman
- should show apt selecting the plucky podman package as the preferredapt-cache policy vim
- should show apt selecting the noble vim package as the preferredBeta Was this translation helpful? Give feedback.
All reactions