Is ‘apt-get’ Deprecated? – Understanding Command Line Changes

16.04aptbashcommand line

Lately, I've seen many people use

sudo apt

instead of

sudo apt-get

Also, Ubuntu keeps telling me to install things by sudo apt

The program 'foo' is currently not installed. You can install it by typing:
sudo apt install foo

(remember, foo is placeholder, not an app)

So, after this popularity in the community about using apt instead of apt-get, I'm starting to think that apt-get is deprecated and can no longer be used in my bash programs.

In my bash programs,

  • do I have to replace all apt-get commands with apt?
  • is apt-get dangerous?
  • will my programs still work?

Best Answer

apt-get is lower level and backwards compatible. apt is better for end-users and doesn't require or contain some extra features in that are present in apt-get.

Both are perfectly fine. apt-get is not deprecated, but your 15.10 installation is :)

Edit: From the man page of apt(8)

The apt command is meant to be pleasant for end users and does not need to be backward compatible like apt-get(8).

Edit2: apt was designed to fix some of the fundamental dependency flaws in apt-get. As it is a wrapper, apt is therefore higher level, and also loses some backward compatibility and scripting features.