Debian, Advanced Package Tool (APT), and dpkg

Installing and uninstalling with apt-get

apt-get

package updates

to get list of packages possible updates

apt-get update

to upgrade packages

apt-get upgrade

debian install package

apt-get install <package>

purge removes conf files too

apt-get remove <package>
apt-get purge <package>

sources.list

/etc/apt/sources.list

/etc/apt/sources.list.d/

Building from source

Installing from source

rebuild package from source:

Download the source:

apt-get source <package>

gets dependencies of building package

apt-get build-dep <package>
dpkg-buildpackage -rfakeroot -uc -b (from source code folder)

the above results in a .deb file

dpkg -i <package_file>.deb

Other

apt

apt exists as alternative to apt-get and apt-cache. front end for it, somewhat more user friendly

SORT

apt list --installed

dpkg, apt, aptitude, sources.list

apt-src

Streamlined way to install from source.

apt-src install <package>

downloads vanilla source, dsc (?), a .changes file, source tree?

apt-src build <package>
dpkg --install <path to compiled .deb>

or:

apt-src --build install <package>

does all in one line

apt-mirror

not installed by default on debian or ubuntu

Allows you to set up a mirror repository of packages.

Can then point sources.list for systems to point to the mirror.