Last active
December 29, 2015 20:29
-
-
Save jhrcz/7724503 to your computer and use it in GitHub Desktop.
list version differences in package version for yum update
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
#!/bin/bash | |
# based on | |
# http://arstechnica.com/civis/viewtopic.php?f=16&t=1081335 | |
echo \"package name\",\"current version\",\"update version\" | |
yum -q check-update| while read i | |
do | |
i=$(echo $i) #this strips off yum's irritating use of whitespace | |
if [ "${i}x" != "x" ] | |
then | |
UVERSION=${i#*\ } | |
UVERSION=${UVERSION%\ *} | |
PNAME=${i%%\ *} | |
PNAME=${PNAME%.*} | |
VERSION=$(rpm -q "${PNAME}" --qf '%{VERSION}-%{RELEASE}') | |
printf "%-30s\n%60s\n%60s\n\n" "$PNAME" "$VERSION" "$UVERSION" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment