Skip to content

Instantly share code, notes, and snippets.

@jhrcz
Last active December 29, 2015 20:29
Show Gist options
  • Save jhrcz/7724503 to your computer and use it in GitHub Desktop.
Save jhrcz/7724503 to your computer and use it in GitHub Desktop.
list version differences in package version for yum update
#!/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