Why is the "apt" command not found?
Solution 1:
Starting in Ubuntu 14.04, there is a command in Ubuntu called just
apt
, which didn't exist when this question was originally asked. Theapt
command provides a convenient subset of the functionality of various otherapt-
commands (e.g.,apt-get
,apt-cache
), with colorized display and progress bars. Although theapt
command does not support all the same actions and options asapt-get
, it may often be used in place ofapt-get
. See Fsando's answer for details.
APT is a suite of utilities, including a database of information about what packages are available from where.
APT is not a single command. Rather, it provides several commands.
The most commonly used APT command is apt-get
. That's what you should probably be using.
To update information about what packages are available and from where (which you should do before attempting to upgrade or install any packages with apt-get
), run:
sudo apt-get update
To upgrade packages (i.e., "update your system"), run:
sudo apt-get upgrade
To upgrade packages, including packages that require uninstalled packages to be installed, or installed packages to be removed, run this (but be careful--it's best to pay attention to what will be added or removed):
sudo apt-get dist-upgrade
To install one or more packages, run this, replacing ...
with the list of packages you want to install (if you want to install more than one package, put spaces between the package names):
sudo apt-get install ...
To remove one or more packages (i.e., to uninstall it), run:
sudo apt-get remove ...
To remove a package and also remove its systemwide configuration files (but not its per-user configuration files, which reside in users' home directories), run:
sudo apt-get purge ...
To remove packages that were installed automatically because other packages needed them, but which now are no longer needed, run:
sudo apt-get autoremove
To do that, and also remove their global configuration files"
sudo apt-get --purge autoremove
To reinstall a package, run:
sudo apt-get --reinstall install ...
To reinstall a package and delete its systemwide configuration files while doing so:
sudo apt-get --purge --reinstall install ...
To delete cached package installer (.deb
) files (which does not remove any packages, but will make it so they have to be fetched over the network again to be reinstalled):
sudo apt-get clean
To deleted cached package installer files, but only for packages that are unlikely to be needed again (i.e., those that are so old they've been removed from the servers, as of last time sudo apt-get update
was run):
sudo apt-get autoclean
That was just a brief overview. It does not capture all possible uses of apt-get
, plus there are a number of other utilities provided in the APT suite, such as apt-cache
for examining information about installed and available packages.
You can learn more by reading the apt-get
and apt
manual pages.
Solution 2:
There is no command just apt
for that you've gotten this error. The list that
Eliah Kagan provided you with can be a resource for using APT utilities but as answer for your question the problem in your writing of the command.
Solution 3:
apt is an actual command in 14.04 and it relates to apt-get and friends as can be seen here:
:~# apt
apt 1.0.1ubuntu2 for amd64 compiled on Oct 28 2014 20:55:14
Usage: apt [options] command
CLI for apt.
Basic commands:
list - list packages based on package names
search - search in package descriptions
show - show package details
update - update list of available packages
install - install packages
remove - remove packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
edit-sources - edit the source information file
Solution 4:
Are you trying to run apt-get?
Try running
sudo apt-get update
Let me know how that works.