Quick PSA: how to create a new F30 toolbox container and migrate your old packages

So with the Silverblue branch for F30 set up and the beta around the corner, I figured it was time to stop running toolbox --release 29 enter to use my old F29 toolbox and upgrade it + renam—oh wait, you can’t rename podman containers. Well, then…

I just decided to create a new toolbox container for Fedora 30 and figured I should write this here for anyone else coming along.

Creating the container

registry.fedoraproject.org's F30 toolbox image is still targeting rawhide. Now, the easiest way to grab a proper branched 30 is to create the image with toolbox create --candidate-registry, which will use the candidate registry that has a branched F30 toolbox image.

Failing that (for some reason), you can convert the rawhide image to a branched one via:

sudo dnf config-manager --set-enabled fedora --set-enabled fedora-modular --set-enabled updates --set-enabled updates-modular
sudo dnf config-manager --set-disabled rawhide --set-disabled rawhide-modular
sudo dnf distro-sync

If you already ran an upgrade as rawhide, you’ll have to add a --releasever 30 to distro-sync.

Moving your packages

Of course, I don’t want to trial-and-error all the packages I want. There are three steps to moving them all over:

Run a system upgrade

Yes, you should run a full upgrade first, sudo dnf upgrade.

Move over your repos

You can run sudo dnf repolist to see all your enabled repos. The TL;DR for the most common ones:

  • RPMFusion: Follow the standard directions.
  • Negativo17 multimedia: sudo dnf config-manager --add-repo=https://negativo17.org/repos/fedora-multimedia.repo.
  • Any COPRs: sudo dnf copr enable -y copr-name-goes-here, make sure there’s an F30 version. If not, you can kindly email the maintainer asking them to enable F30 builds (and maybe wait for the beta to release first).
  • Any that you may not know the source from: If it properly uses $releasever, you can cp /etc/yum.repos.d/my-repo.repo to your $HOME on your old F29 container and then cp it in your new container. That being said, I’d question how you ended up with repos you don’t know the source for…

Actually installing the packages

Run sudo dnf history userinstalled to see all installed package and flag down any you may want to remove. Next, we’re going to generate a list of all the installed packages (excluding the ones you want to remove) from the F29 container:

dnf repoquery --qf '%{name}' --userinstalled | grep -Ev 'debuginfo|^fedora-' > ~/playground/f29-package-list

This will list all the packages, excluding the fedora-release and debuginfo ones. If you want to add more, add them to the end of the regex, e.g. if you want to omit zstd then the new regex would be debuginfo|^fedora|zstd.

Now you can install them in the new container:

sudo xargs -a ~/f29-package-list dnf install -y

If you also want the debuginfo packages, you can grab them with this running on the F29 toolbox:

dnf repoquery --qf '%{name}' --userinstalled | grep -Po '^.*(?=-debuginfo$)' > ~/f29-debuginfo-list

And then run this on the F30 toolbox:

sudo xargs -a ~/f29-debuginfo-list dnf debuginfo-install -y

Happy toolboxing! (Err, tool boxing? Tool-boxing? Toolboxxing? Ehh…)

1 Like