-
Notifications
You must be signed in to change notification settings - Fork 1
Installing software (apt)
This page covers software installation on Debian and Ubuntu based systems.
Background
Like the Apple App Store, pre-compiled binaries are stored in your distro's software repositories ready for you to download and install. These "packages" are stable and secure. A CLI-based tool is used to interact with software repositories. If the package is not found in the official repositories, you may add third party repositories to your package manager, or you can compile the software from source.The option [-y]
assumes yes to all questions (confirmations). Every package manager sub-command listed below besides search
requires root privileges.
All Debian based distros, such as Ubuntu (and all Ubuntu based distros) use dpkg
and apt
.
-
apt install PKG
installs the package listed. (accepts multiple parameters) -
apt remove [--purge] PKG
uninstalls the package. (accepts multiple parameters)-
--purge
, all (modified) configuration and data files are deleted as well.
-
-
apt update
downloads all packages' information. -
apt upgrade [pkg]
upgrades the specified package, or upgrades every installed out-of-date package. (accepts multiple parameters) -
apt autoremove
removes all orphaned packages (unused dependencies). -
apt search KEYWORD
searches the repository forKEYWORD
.
If the package is not in the official repos,
-
dpkg -i PACKAGE.deb
installs a local package. -
sudo add-apt-repository ppa:NAME/REPO && sudo apt-get update
adds and configures third party repos to the package manager.
aptitude
is an advanced alternative to apt
.
Rarely, you will need to use software not found in your distro's official software repositories. Binaries can be generated by compiling from scratch with GNU autotools.
On Ubuntu: sudo apt install build-essential
The README
or INSTALLATION
file will likely provide information on dependencies and how to compile the software. It ususally follows this process:
-
./configure
optimizes the build system for your machine. -
make
generates the binaries. -
make install
moves the binaries to directories in your$PATH
, like/usr/local/bin/
. This command might needsudo
.
Not recommended.
Decompress the files and move the binaries to /opt/
. Add the binaries to $PATH
.