My most recent pain in the rear came tonight when I finally decided it was time to figure out why my msfupdate wasn't actually performing an update. Each time I ran it over the last month, I noted the failure and kept pushing on with whatever target I was going after. Tonight, much to my chagrin, has been all but wasted on WAITING for 115 updates to download and be applied to my Kali VM. This was after I found a solution to the error I was getting when I attempted to run apt-get upgrade -f:
...
dpkg: error: parsing file '/var/lib/dpkg/available' near line 14392 package 'libpurple-bin':
which returned an error code of (2). After my looking and searching around, I learned the following:
- libpurple-bin is part(all?) of pidgin, the Instant Messenger program...that I do not use on that particular Kali VM
- the actual line, 14392, of /var/lib/dpkg/available ended up containing garbage
- in the same directory, unknown to me until I looked, was available-old, which had the same date/time stamp as 'available' but a different size (smaller)
- mv /var/lib/dpkg/available /var/lib/dpkg/available_ERR_Line_14932.orig
- cp /var/lib/dpkg/available-old /var/lib/dpkg/available
In trying to find the problem, I noticed that there were a LOT of posts with related errors dealing with /var/lib/dpkg/status, or in a few cases, the entire /var/lib/dpkg directory. Before doing what one forum poster did, which was accidentally removing the entire directory, I'd suggest the following for anyone who faces this annoying error:
- first, check to see if the system already has a backup of whatever dpkg file is giving you pains
- if there isn't a backup of the last working file you need, you can try to fix the issue by copying said file from either the latest installation media or from another VM of the same flavor
- sudo dpkg --configure -a
- apt-get clean
- apt-get update -f
- apt-get upgrade -f
Hope this helps the next nerd to have this issue! Now, back to PHP reverse shells! :-)