23
sudo: apt: command not found

What does this error mean? The apt command is not working, and I've lost the Software Center.

3
  • 1
    You need to useapt-get in the command instead of apt.
    – nanofarad
    Sep 30, 2012 at 23:55
  • 8
    To people voting to close this: This is definitely a real question, and there is already enough information for it to be answered. We should not close this question. I'll post a CW answer that include information others have said. Oct 1, 2012 at 1:41
  • I had the same problem, since I wanted to use apt-get to install something. It seems 'yum' was the default package manager in my case, which I should have used instead. Reference: unix.stackexchange.com/questions/33688/… Jan 7, 2013 at 9:07

4 Answers 4

13

Starting in Ubuntu 14.04, there is a command in Ubuntu called just apt, which didn't exist when this question was originally asked. The apt command provides a convenient subset of the functionality of various other apt- commands (e.g., apt-get, apt-cache), with colorized display and progress bars. Although the apt command does not support all the same actions and options as apt-get, it may often be used in place of apt-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.

1
  • 1
    You could also add info about creating a bash alias for apt..
    – jokerdino
    Oct 1, 2012 at 4:29
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.

2

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
0

Are you trying to run apt-get?

Try running

sudo apt-get update

Let me know how that works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .