• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

apt: command not found

by admin

The Advanced Package Tool (APT) is a command-line tool used to interact easily with the dpkg packaging system. APT is the ideal method used for managing software within Debian-based Linux distributions, such as Ubuntu. It manages dependencies effectively, maintains large configuration files, and properly handles upgrades and downgrades to ensure system stability. On its own, dpkg does not handle dependencies properly.

In Debian/Ubuntu-based distributions, software management is done via the apt utility, which is a recent replacement for the utilities apt-get and apt-cache. The most-used commands include:

Command Description
apt list List packages
apt search Search in descriptions
apt install Install a package
apt show Show package details
apt remove Remove a package
apt update Update catalog of available packages
apt upgrade Upgrade the installed software
apt edit-sources Edit the repository configuration

If you encounter below error while running the apt command:

apt: command not found

you may try installing the apt package as per your choice of distribution.

Distribution Command
Debian apt-get install apt
Ubuntu apt-get install apt
Arch Linux pacman -S apt
Kali Linux apt-get install apt
CentOS yum install apt
Fedora dnf install apt
Raspbian apt-get install apt

apt Command Examples

1. Update the list of available packages and versions (it’s recommended to run this before other `apt` commands):

$ sudo apt update

2. Search for a given package:

$ apt search package

3. Show information for a package:

$ apt show package

4. Install a package, or update it to the latest available version:

$ sudo apt install package

5. Remove a package (using `purge` instead also removes its configuration files):

$ sudo apt remove package

6. Upgrade all installed packages to their newest available versions:

$ sudo apt upgrade

7. List all packages:

$ apt list

8. List installed packages:

$ apt list --installed

Filed Under: Linux, Ubuntu

Some more articles you might also be interested in …

  1. kill: command not found
  2. atop Command Examples in Linux
  3. How to identify the HBA cards/ports and WWN in Linux
  4. Linux OS Service ‘smartd’
  5. Linux OS service ‘auditd’
  6. How to Change Default Port of Apache On RHEL/CentOS 7
  7. fuser: command not found
  8. ffuf Command Examples in Linux
  9. uname: command not found
  10. How to edit Virtual Machine Hardware in RedHat Virtualization

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright