MEWBIES@: Facebook Twitter G+ YouTube DeviantArt Forum Wall
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ██
█▌ - HOW TO PACKAGE INFORMATION, STATUS, VERSION, AND CONTENTS - █▌
█▌ LINUX █▌
█ ▐▌
█ Various methods how to view package information such as status, version, ▐▌
█ list of all contents, search packages for a file, e-mail changelog, etc. ▐▌
█ ▐▌
█ ____.----. ▐▌
█ ____.----' \ ▐▌
█ \ \ ▐▌
█ \ \ ▐▌
█ \ \ ▐▌
█ \ ____.----'`--.__ ▐▌
█ \___.----' | `--.____ ▐▌
█ /`-._ | __.-' \ ▐▌
█ / `-._ ___.---' \ ▐▌
█ / `-.____.---' \ ▐▌
█ / / | \ \ ▐▌
█ / / | \ _.--' ▐▌
█ `-. / | \ __.--' ▐▌
█ `-._ / | \ __.--' | ▐▌
█ | `-./ | \_.-' | ▐▌
█ | | | ▐▌
█ | | | ▐▌
█ | | | ▐▌
█ | | | ▐▌
█ | | | VK ▐▌
█ | | | ▐▌
█ _______| | |_______________ ▐▌
█ `-. | _.-' ▐▌
█ `-. | __..--' ▐▌
█ `-. | __.-' ▐▌
█ `-|__.--' ▐▌
█ STATUS OF A PACKAGE ▐▌
█ HOW TO VIEW THE STATUS OF ALL PACKAGES INSTALLED ▐▌
█ HOW TO VIEW THE STATUS AND VERSION OF AN INSTALLED PACKAGE ▐▌
█ HOW TO VIEW RECENTLY INSTALLED PACKAGES WITH DATE ▐▌
█ HOW TO REMOVE OR PURGE ALL PACKAGES WITH THE SAME STATUS ▐▌
█ ▐▌
█ LIST ALL FILES AND INSTALL LOCATION OF AN INSTALLED PACKAGE ▐▌
█ HOW TO VIEW CONTENTS OF A .DEB FILE ▐▌
█ HOW TO VIEW THE CONTENTS OF A PACKAGE INSTALLED OR NOT ▐▌
█ HOW TO VIEW WHICH PACKAGE A FILE BELONGS TO ▐▌
█ HOW TO QUICKLY VIEW ALL LOCATIONS ON THE SYSTEM OF A FILE ▐▌
█ HOW TO VIEW PACKAGE CHANGELOG ENTRIES FROM DEBIAN PACKAGE ARCHIVE ▐▌
█ ▐▌
█ Status of a package is represented by the three characters in the first ▐▌
█ column, for example: ▐▌
█ ii libsdl1.2debian:i386 1.2.15-5 i386 ▐▌
█ rc libsdl1.2debian-alsa 1.2.14-6.1 i386 ▐▌
█ ▐▌
█ First character is the 'desired' state: ▐▌
█ h: hold ▐▌
█ i: install ▐▌
█ p: purge ▐▌
█ r: remove ▐▌
█ u: unknown state ▐▌
█ ▐▌
█ Second character is the 'current' state: ▐▌
█ c: configuration files are present ▐▌
█ f: failed - configuration files failed to remove ▐▌
█ h: half installed - partially installed ▐▌
█ i: installed ▐▌
█ n: not installed ▐▌
█ U: unpacked ▐▌
█ W: wait ▐▌
█ t: trigger pending ▐▌
█ ▐▌
█ Third character: ▐▌
█ R: reinstall required ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ TO VIEW THE STATUS OF ALL PACKAGES INSTALLED: ▐▌
█ dpkg -l | less ▐▌
█ Output example: ▐▌
█ [snip] ▐▌
█ ii libsdl1.2debian:i386 1.2.15-5 i386 ▐▌
█ rc libsdl1.2debian-alsa 1.2.14-6.1 i386 ▐▌
█ [snip] ▐▌
█ ▐▌
█ To view only selected packages' status; add the package's name(s), i.e.: ▐▌
█ dpkg -l gcc make openssh-server mysql-server libmysql++-dev ▐▌
█ ▐▌
█ To search for a package in the repository, for example libmysql++-dev: ▐▌
█ aptitude search libmysql++-dev ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ TO VIEW THE STATUS AND VERSION OF AN INSTALLED PACKAGE: ▐▌
█ dpkg -s <packagename> ▐▌
█ For example: dpkg -s python ▐▌
█ Or: aptitude show python ▐▌
█ Or: apt-cache show python ▐▌
█ ▐▌
█ Each will differ slightly in their output. ▐▌
█ Output example: ▐▌
█ Package: python ▐▌
█ Source: python-defaults ▐▌
█ Version: 2.7.3-4+deb7u1 ▐▌
█ Installed-Size: 658 ▐▌
█ [snip] ▐▌
█ ▐▌
█ To view a package's version only: ▐▌
█ dpkg -s python | grep -i "version:" ▐▌
█ aptitude show python | grep -i "version:" ▐▌
█ apt-cache show python | grep -i "version:" ▐▌
█ Output example: Version: 2.7.3-4+deb7u1 ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO VIEW RECENTLY INSTALLED PACKAGES WITH DATE ▐▌
█ ▐▌
█ To view recent 'apt-get' history: ▐▌
█ cat /var/log/apt/history.log | grep "\ install\ " ▐▌
█ ▐▌
█ To view all recently installed packages, with date, listed in the current ▐▌
█ log: ▐▌
█ cat /var/log/dpkg.log | grep "\ install\ " ▐▌
█ In the previous log: ▐▌
█ cat /var/log/dpkg.log.1 | grep "\ install\ " ▐▌
█ In an archived log, e.g. 2.gz: ▐▌
█ zcat /var/log/dpkg.log.2.gz | grep "\ install\ " ▐▌
█ ▐▌
█ Jose Catre-Vandis at UbuntuForums.org wrote a nice script, here, to output ▐▌
█ a full list of all packages installed with date: ▐▌
█ cd ~ && pico pkginstalls.sh ▐▌
█ paste in the code (copy here in case link goes dead), save file then: ▐▌
█ chmod a+x pkginstalls.sh && ./pkginstalls.sh ▐▌
█ cat pkginstalls.txt | less ▐▌
█ Or for example to list only packages installed in year 2014: ▐▌
█ cat pkginstalls.txt | less | grep 2014 ▐▌
█ After you are done rm pkginstalls.txt or rename it so that next run of ▐▌
█ pkginstalls.sh output is correct; as it appends to the file. ▐▌
█ ▐▌
█ ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ TO REMOVE OR PURGE ALL PACKAGES WITH THE SAME STATUS: ▐▌
█ To, for example, only show all packages marked as 'rc': ▐▌
█ dpkg -l |grep "^rc" ▐▌
█ Output example: ▐▌
█ rc libeggdbus-1-0 0.6-1 i386 ▐▌
█ rc libept0 0.5.22 i386 ▐▌
█ ▐▌
█ To show only package 'names' marked as 'rc': ▐▌
█ dpkg -l |grep "^rc" | cut -d " " -f 3 ▐▌
█ ▐▌
█ To purge (remove binary and its configuration files) a single package: ▐▌
█ dpkg -P <package name> ▐▌
█ ▐▌
█ To purge all packages marked as rc: ▐▌
█ dpkg -l |grep "^rc" | cut -d " " -f 3 | xargs dpkg -P ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ LIST ALL FILES AND INSTALL LOCATION OF AN INSTALLED PACKAGE: ▐▌
█ To view a list of files and their paths of an install package, time for ▐▌
█ example: ▐▌
█ dpkg -L time ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO VIEW CONTENTS OF A .DEB FILE: ▐▌
█ To view the contents of a deb file: ▐▌
█ dpkg -c name.deb ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO VIEW THE CONTENTS OF A PACKAGE INSTALLED OR NOT: ▐▌
█ To view the contents of a package regardless if it is installed or not: ▐▌
█ su ▐▌
█ aptitude update && aptitude install apt-file ▐▌
█ Then sync the packages from their sources: ▐▌
█ apt-file update ▐▌
█ exit ▐▌
█ Then to view contents of a package: ▐▌
█ apt-file list mew-bin ▐▌
█ ▐▌
█ If you want to cache the list in your home directory: ▐▌
█ apt-file update ▐▌
█ To switch back to system-wide cache directory: ▐▌
█ apt-file purge ▐▌
█ Help: apt-file -h and man apt-file ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO VIEW WHICH PACKAGE A FILE BELONGS TO: ▐▌
█ This is handy when you have an x error file is missing to find the ▐▌
█ original install location of a file: ▐▌
█ apt-file search file.name ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO QUICKLY VIEW ALL LOCATIONS ON THE SYSTEM OF A FILE: ▐▌
█ Instead of searching the entire system for x file you can use locate which ▐▌
█ builds a db of all files and you search that. ▐▌
█ su ▐▌
█ aptitude update && aptitude install locate ▐▌
█ Then build to build slocate database of files (wait for it to finish): ▐▌
█ updatedb ▐▌
█ exit ▐▌
█ To find all locations for a file, for example libmysqlclient.so: ▐▌
█ locate libmysqlclient.so ▐▌
█ Any new files on the system will not be in its database until updatedb is ▐▌
█ run again. ▐▌
█ If your setup isn't running updatedb daily, like mine, I just added it to ▐▌
█ cron. Find location of your updatedb: ▐▌
█ which updatedb ▐▌
█ My output: /usr/bin/updatedb ▐▌
█ su ▐▌
█ crontab -e ▐▌
█ Paste in at the bottom, with the correct path to your updatedb, and save ▐▌
█ changes to have updatedb run once daily at 6:30 A.M: ▐▌
█ 30 06 * * * /usr/bin/updatedb /dev/null 2 &1 ▐▌
█ exit ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO VIEW PACKAGE CHANGELOG ENTRIES FROM DEBIAN PACKAGE ARCHIVE: ▐▌
█ "The tool apt-listchanges can compare a new version of a package with the ▐▌
█ one currently installed and show what has been changed, by extracting the ▐▌
█ relevant entries from the Debian changelog and NEWS files. ▐▌
█ It can be run on several .deb archives at a time to get a list of all ▐▌
█ changes that would be caused by installing or upgrading a group of ▐▌
█ packages. When configured as an APT plugin it will do this automatically ▐▌
█ during upgrades." ▐▌
█ ▐▌
█ su ▐▌
█ aptitude install apt-listchanges ▐▌
█ Configure apt-listchanges: ▐▌
█ dpkg-reconfigure apt-listchanges ▐▌
█ These are the settings I selected: ▐▌
█ pager ▐▌
█ Yes (to skip) ▐▌
█ Remove text 'root' and enter the e-mail address for apt-listchanges output ▐▌
█ sent to. ▐▌
█ Details: both ▐▌
█ Prompt: No ▐▌
█ Done ▐▌
█ exit ▐▌
█ man apt-listchanges ▐▌
█ ▐▌
█ //---------------------------------------------------------------------- ▐▌
█ ▐▌
█ If you find mistakes, have suggestions, and or questions please post at ▐▌
█ mewbies forum HERE - thank you. ▐▌
█ ▐▌
█ Last update on 31 Mar '14 ▐▌
█ ▐▌
█▌ █▌
█▌ - mewbies.com - █▌
█▌ █▌
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██