Skip to content

Instantly share code, notes, and snippets.

@anderbubble
Created October 14, 2022 16:51
Show Gist options
  • Save anderbubble/4d72f7ca5d9ef426230320d7f1187934 to your computer and use it in GitHub Desktop.
Save anderbubble/4d72f7ca5d9ef426230320d7f1187934 to your computer and use it in GitHub Desktop.
#!/bin/bash
# migrate2rocky, when migrating from CentOS Stream, will retain packages
# that are newer than those in the target version of Rocky. This script
# attempts to show which packages are retained from Stream by checking
# whether each of them is available in active repos.
dnf makecache
rpm -qa | while read installed_package
do
repo_package=$(dnf --cacheonly --quiet repoquery "${installed_package}")
if [ -z "${repo_package}" ]
then
echo "${installed_package}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment