required operation command line note
check if package is installed – using "rpm"
rpm -qa|grep 'packagename'
In grep part specify at least part of the name of the checked package like 'monit' or'postgresql' etc.
check if package is installed – using "yum" (RedHat+CenOS)
yum list installed |grep 'packagename'
check if package is installed – using "aptitude" (Ubuntu+Debian)
dpgk --get-selections|grep 'packagename'
show available versions of package – using "aptitude" (Ubuntu+Debian)
apt-cache showpkg packagename
If you do not see version you want go to the http://snapshot.debian.org/ and search for package name. Download package using wget and install using "sudo dpkg -i package_name"
search for available packages – using "aptitude" (Ubuntu+Debian)
apt-cache search packagename
install older version of package – using "aptitude" (Ubuntu+Debian)
sudo apt-get install packagename=version
use full version name you got using previous command
prevent updates of package – using "aptitude" (Ubuntu+Debian)
sudo apt-mark hold packagename
repair missing dependencies (Ubuntu+Debian) – run it after you get error messaged for missing dependencies for some package
sudo apt-get -f install
clean apt cache (deletes downloaded packages from the directory "/var/cache/apt/archives")
sudo apt-get clean
clean unused packages
sudo apt-get autoclean