Created
April 3, 2025 18:21
-
-
Save phpclub/e08cf5861f4fa175ccb9baedb038a3a0 to your computer and use it in GitHub Desktop.
How to replicate installed package selection from one Almalinux instance to another?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the Dnf repoquery subcommand supports has a new option for listing all user-installed packages: | |
$ dnf repoquery --qf '%{name}' --userinstalled \ | |
| grep -v -- '-debuginfo$' \ | |
| grep -v '^\(kernel-modules\|kernel\|kernel-core\|kernel-devel\)$' > pkgs_a.lst | |
In contrast to other methods, it also lists all debuginfo packages. The additional grep in the above example filters them out. | |
To install the list on host B: | |
$ < pkgs_a.lst xargs dnf -y install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment