It’s pretty seldom that you have to install packages that aren’t part of the official repositories (for which apt-get is king), but every now and then you will be presented with a .deb application installer file and told to install it on your server.
Luckily this is pretty painless, so long as you know the correct command, which is exactly why I’m noting it down here for future reference.
Packages are manually installed via the dpkg command (Debian Package Management System). dpkg is the backend to commands like apt-get and aptitude, which in turn are the backend for GUI install apps like the Software Center and Synaptic.
To install a .deb file, run:
sudo dpkg -i myInstaller.deb
If dpkg reports an error due to dependency problems, you can run:
sudo apt-get install -f
Running this should download the missing dependencies and configure everything automatically. If however this step reports an error… well let’s just say that you’ll have to sort out the dependencies yourself, something often referred to as “dependency hell” in the support forums!
Conversely, to uninstall a package, run dpkg with -r:
sudo dpkg -r myInstaller