sudo apt updateRefreshes the package lists from the configured repositories. Run this before installing or upgrading.
Debian and Ubuntu’s package manager: install, update, search and remove software and inspect package sources.
sudo apt updateRefreshes the package lists from the configured repositories. Run this before installing or upgrading.
sudo apt install <package>Installs a package and its dependencies.
Example
sudo apt install nmapsudo apt install --no-install-recommends <package>Skips recommended extras to keep the system lean.
Example
sudo apt install --no-install-recommends ffufsudo apt install ./<file>.debInstalls a local .deb and resolves its dependencies.
Example
sudo apt install ./tool_1.0_amd64.debsudo apt reinstall <package>Reinstalls a package, restoring modified files.
Example
sudo apt reinstall openssh-serversudo apt upgradeUpgrades installed packages without removing any.
sudo apt full-upgradeUpgrades and allows removals when dependencies change.
apt list --upgradableShows pending upgrades.
sudo apt remove <package>Removes a package but keeps its configuration.
Example
sudo apt remove telnetsudo apt purge <package>Removes a package and its configuration.
Example
sudo apt purge apache2sudo apt autoremoveRemoves dependencies no longer needed.
apt search <term>Searches package names and descriptions.
Example
apt search wordlistapt show <package>Version, size, dependencies and description.
Example
apt show hashcatapt list --installedEvery installed package.
apt-cache policy <package>Installed and candidate versions and which repository each comes from.
Example
apt-cache policy openssldpkg -L <package>Files installed by a package.
Example
dpkg -L openssh-serverdpkg -S <path>Which package owns a file.
Example
dpkg -S /usr/bin/ncdpkg --verifyReports installed files whose checksums no longer match the package — a quick integrity check after a compromise.