Generate a list of installed Fedora packages on one device (and install on another)

Last updated on 2022-07-17 Tagged under  #fedora   #linux 

When setting up a new device with Fedora, it can be useful to have an updated list of all packages installed on another device running Fedora, and replicate that configuration on the new device.

This is how I do it.

1. Generate a package list

Generate a list of packages installed on the original device and save to fedora_pkglist.txt ...

$ dnf list installed | grep -v '^Installed' | awk '{print $1}' | sort | uniq > fedora_pkglist.txt

2. Install packages from list

Copy fedora_pkglist.txt to the new device, and install all the packages listed in the file ...

$ PACKAGES=$(cat fedora_pkglist.txt); sudo dnf install $PACKAGES

Note: Confirm the new device lists the same repositories as the original device. Otherwise, some packages listed in fedora_pkglist.txt might not be available to install.

List all enabled repositories on the device ...

$ sudo dnf repolist
Thanks for reading! Read other posts?

» Later: Roll your own Linux desktop using Openbox

« Earlier: Minimal Debian Bullseye