| JP Vossen on 10 Jul 2007 07:17:04 -0000 |
|
Last night at PLUG Montco I asked about the apt equivalent of rpm -Va. I think I found the answer. On an RPM-based Linux system, you can do 'rpm -V' which will: "[... compare] information about the installed files in the package with information about the files taken from the package metadata stored in the rpm database. Among other things, verifying compares the size, MD5 sum, permissions, type, owner and group of each file. [...]" rpm -Va compares everything. This takes forever, but can be interesting in some cases. It turns out that a package called 'debsums' does more or less the same thing. I think someone at the meeting might have mentioned the name, but I didn't write it down then. I just found it using the wajig -t command. Does anyone have a better way than debsums? Wajig (http://www.togaware.com/linux/survivor/Wajig_Overview.html) is a nifty Python script that unifies all the apt tools (apt-*, dpkg*, etc.). It's pretty cool, but I find it to be more complicated than I need, so I've written a simple shell script that uses a case statement to do what I want. Wajig's -t (teach) option is great for seeing just how it works. My script only does about 20 things (wajig does over 100) but it was a useful exercise to "translate" things I knew how to do in RPM to APT. (I have a bit more background in RPM than APT as may be obvious by now). I'll post the script someplace if there is any interest in it. Here's what it does now: COMMANDS * The | in upd|ate means you only need to type the "upd" part. * <names> means one or more space delimited package names * <egrep> means a single egrep regular expression (e.g. 'zip|arj') upd|ate # Update the package cache (do this at least weekly)
che|ck,chk # Check for available upgrades
upche|ck,upchk # Update, then check for available upgrades
upg|rade # Upgrade all installed packages
dist|-upgrade # Really upgrade all installed packages
se|arch;find <regex> # Search for <regex> in the package cache
sh|ow,info <names> # Show details about package <names>
showpkg <names> # Show name and various depends info for <names>
in|stall <names> # Install package <names>
rem|ove <names> # Remove package <names>
# (--purge <names> removes config files too!)
what <egrep> # Show the name and version of <egrep> if installed
which,installed,list <egrep> # Same as previous
files <names> # List the files installed by package <names>
dep|ends <names> # Show packages <names> depends on
rdep|ends <names> # Show other packages that depend on <names>
pro|vides <names> # Show the capability that <names> provides
whatpro|vides <file> # Show the package that provides <file>
clean # Remove downloaded package files from the cache
autoclean # Remove obsolete packages from the cache
purge # Purge the local cache, forces complete re-download
stats # Show package cache stats
|
|