[opensuse] Finding outdated packages
After updating to openSUSE 12.2, I found quite a few packages that were outdated, i.e., didn’t exist in my 12.2 package repositories, and so weren’t upgraded when I ran ‘zypper dup’ (either because I had to forgotten to re-add the 12.2 versions of all the repositories (for example the ‘games’ or ‘security’ repositories), or because the packages were completely removed from all repositories). I couldn’t find a zypper or rpm command for getting a list of such packages, so here’s the commands came up with. Hopefully it will be useful for other people too. packinst=$(mktemp) packavail=$(mktemp) rpm -qa --queryformat='%{name}\n' | sort -u > $packinst zypper pa -i | cut -d'|' -f3 | tr -d ' ' | sort -u > $packavail comm -23 $packinst $packavail | fgrep -v gpg-pubkey To remove (uninstall) all of them, just add | xargs zypper remove to the last line. -- Karl Ove Hufthammer http://huftis.org/ Jabber: karl@huftis.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2012-09-09 16:51, Karl Ove Hufthammer wrote:
I couldn’t find a zypper or rpm command for getting a list of such packages, so here’s the commands came up with. Hopefully it will be useful for other people too.
rpm -q -a --queryformat "%{INSTALLTIME};%{INSTALLTIME:day}; \ %{BUILDTIME:day}; %{NAME};%{VERSION}-%-7{RELEASE};%{arch}; \ %{VENDOR};%{PACKAGER};%{DISTRIBUTION};%{DISTTAG}\n" \ | sort | cut --fields="2-" --delimiter=\; \ | tee rpmlist.csv | less -S or rpm -q -a --queryformat "%{INSTALLTIME}\t%{INSTALLTIME:day} \ %{BUILDTIME:day} %-30{NAME}\t%15{VERSION}-%-7{RELEASE}\t%{arch} \ %25{VENDOR}%25{PACKAGER} == %{DISTRIBUTION} %{DISTTAG}\n" \ | sort | cut --fields="2-" | tee rpmlist | less -S Documented here: http://en.opensuse.org/SDB:Offline_upgrade - -- Cheers / Saludos, Carlos E. R. (from 11.4 x86_64 "Celadon" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREIAAYFAlBM7VUACgkQja8UbcUWM1zjFQD/c3oL1Cw0LOkNw8vRdddz/uSU FvhW11THxxzSWSi3UvoA/2hYjVmpgfqEXSQfRDEOsJpYjaMWxHhNgZ0madArIkde =NJV7 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
su. den 09. 09. 2012 klokka 21.26 (+0200) skreiv Carlos E. R.:
I couldn’t find a zypper or rpm command for getting a list of such packages, so here’s the commands came up with. Hopefully it will be useful for other people too.
rpm -q -a --queryformat "%{INSTALLTIME};%{INSTALLTIME:day}; \ %{BUILDTIME:day}; %{NAME};%{VERSION}-%-7{RELEASE};%{arch}; \ %{VENDOR};%{PACKAGER};%{DISTRIBUTION};%{DISTTAG}\n" \ | sort | cut --fields="2-" --delimiter=\; \ | tee rpmlist.csv | less -S
Though it’s a command for a different question. The above gives a list of packages by installation date, for manual inspection, which is more complicated than just looking a clean list of packages no longer available. (A package may be recently installed but still removed from the package repositories – either moved to a different repository, or just removed, e.g., for legal reasons.) But it’s a useful set commands, anyway. Though I prefer the much shorter rpm -qa --last (You can add --queryformat to this too.) -- Karl Ove Hufthammer http://huftis.org/ Jabber: karl@huftis.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2012-09-09 22:02, Karl Ove Hufthammer wrote:
su. den 09. 09. 2012 klokka 21.26 (+0200) skreiv Carlos E. R.:
just removed, e.g., for legal reasons.) But it’s a useful set commands, anyway. Though I prefer the much shorter
rpm -qa --last
Yes, but one of the fields I do says to which distribution a package belongs to and you can decide what to do with it (not all packages from all openSUSE versions had this field correctly). I do not trust automatics. Some I search for a repo that contains it and then upgrade it. - -- Cheers / Saludos, Carlos E. R. (from 11.4 x86_64 "Celadon" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREIAAYFAlBNFp4ACgkQja8UbcUWM1y+WAD9HTUVdyGTpvbuwfaWl1DM9QHl HWj3ijriT/Qk9BimMZcA/2iiuPBgYyYB0s1/cW+09n5shSA4X+5DO99GthZzQDbO =oHY2 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Carlos E. R.
-
Carlos E. R.
-
Karl Ove Hufthammer