apt

>Usage

The apt command is a package management tool used in Debian-based Linux distributions (like Ubuntu) to install, update, upgrade, and remove software. It automates the process of managing software packages, including resolving dependencies and retrieving packages from configured repositories

The apt command simplifies and improves upon older commands like apt-get, providing a more user-friendly interface for package management tasks.

>Synopsis

apt [command] [option]

>Commands

update

Updates the list of available packages and versions.

upgrade

Upgrades all installed packages to the latest versions.

install

Installs a specified package.

remove

Uninstalls a specified package.

search

Searches for packages related to a specific name.

>Options

-c

This command updates the package list using the specified configuration file instead of the default one. Output will depend on the configuration file settings.

Example:

Dots

-c

> sudo apt -c /path/to/custom-config-file.conf update


Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done

-q=2

This command updates the package list with almost no output unless there are critical errors.

Example:

Dots

-q=2

> sudo apt -q=2 update


-y

Installs a specified package without prompting for confirmation

Example:

Dots

-y

> apt -y vim install


Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
vim
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 1,152 kB of archives.
After this operation, 3,235 kB of additional disk space will be used.

>Quiz

Progress: Question ? out of ?

Question Title

Page written by Cyrus Kamau Nganga