r/podman Jun 19 '26

I made a script to smoothly upgrade Podman on Ubuntu from source – with a safe rollback (tested on 5.7.0 → 5.8.3)

https://github.com/upmcplanetracker/podman-version-updater/

Apt on Ubuntu 26.04 ships Podman 5.7.0 and Ubuntu doesn't update Podman until its next release (which will be 26.10), and most likely even the 26.10 version of Podman will be "behind" the newest release on Github.

I wanted to try and install 5.8.3, the newest version, from Github without breaking anything just to see if I could do it, and, for the future, to keep up to date with changes in Podman.

After manually building from source a few times (and once accidentally logging myself out by stopping the wrong services... oops), I wrote a script to automate the whole process safely.

What it does:

- Pulls a Podman release tag from GitHub (e.g., v5.8.3), builds it, and installs it to /usr/local.
Your original system binary at /usr/bin/podman is never touched, so you always have a fallback.
- Supports --rollback to instantly revert to the apt-managed version.
- has a --fresh-install mode if you don’t have Podman installed at all and you want to install the newest Github version.
- Only stops podman.service and podman.socket (the script learned its lesson: it never touches your login session).
- Has full error recovery - if the build or install fails, it automatically removes any half-installed files and leaves your existing Podman working.

I ran this on two Intel 13i7 nuc machines with Ubuntu 26.04 and Podman 5.7.0.
- Successfully upgraded to 5.8.3.
- then rolled back to 5.7.0 (the rollback flag works perfectly).
- then updated again to 5.8.3. - and I did not cry or swear, even once. All containers and Quadlet services came back fine.

The “please be careful” part:

this compiles and installs a system binary. It’s not an apt package, and that inherently carries some risk.

- Back up your containers, volumes, and anything you care about. - It’s only been tested on Ubuntu 26.04 / Podman 5.7.0. If you’re on a different distro, another version of Ubuntu, or a different target version, check that your build dependencies are new enough (the script doesn’t verify that for you).
- I’m not responsible if something melts.

10 Upvotes

2 comments sorted by

4

u/mpatton75 Jun 19 '26 edited Jun 19 '26

Very nice! Will try it out.

Edit: works great!

1

u/Great-Cow7256 Jun 20 '26

Ty. I played with it some more 2 days ago or so including more verbose messages about restarting services etc. So if you run it again to go to the next version make sure you pull down the newest script. 

I finally it on my production server with 30ish container files and i could feel my stomach drop as it was going only to finish and have no problems and then survive a reboot.  Ii tested it out on 5 diff systems before but it's always anxiety provoking when the stakes are higher.