Finding and killing processes using ports

First, run

sudo netstat -lpn | grep port_number

This will return a process name and id, such as

unix  2      [ ACC ]     STREAM     LISTENING     121704   5006/gnome-session  /

Kill the process per the PID, in this case 5006.

sudo kill -9 5006


Apt Miscellany

Sources.list is in /etc/apt/

Actual packages.gz lists are in /var/lib/apt/lists/*

The .deb archive is in /var/cache/apt/archives

To force an upgrade of all packages (i.e., no package left behind), run

sudo apt-get dist-upgrade

A useful link on fixing dpkg errors: