- Cheat Sheet and Example is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools






Linux Command#Software

How to use apt Command in Debian/Ubuntu

Commands List

Installing Package

Command Objective Example
apt install PACKAGE
apt install -y PACKAGE
Performs the requested action on one or more packages specified via regex, glob or exact match.
apt -f install
apt install --just-print PACAGE Install test
apt update update is used to download package information from all configured sources.
apt upgrade upgrade is used to install available upgrades of all packages currently installed on the system
apt full-upgrade full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to
upgrade the system as a whole.

Removing Package

Command Objective Example
apt remove PACKAGE
apt remove --purge PACKAGE
apt autoremove
apt autoclean
apt clean

Checking Package

Command Objective Example
apt search PATTERN apt search php
apt list PACKAGE apt list php
apt list --installed
apt list --upgradeable
apt show PACAGE Package Detail Infomation apt show php
echo "PACAKAGE hold" | dpkg --set-selections
echo "PACAGE install" | dpkg --set-selections
cat /var/log/apt/history.log

os/linux/command/apt.html.txt ยท Last modified: 2021/02/16 by admin

Page Tools