1

What is the meaning of the following sentence regarding the difference between apt-get and apt?

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

3

1 Answer 1

6

It means that apt and apt-get have similar functionality, the difference being that apt is intended to be used interactively whereas apt-get is supposed to be used in scripts.

The behavior, effect and output of apt-get are maintained unchanged (that's what "backward compatible" means), so that scripts can rely on them. apt is more free to change with the times and may not function as expected if you run the same script sometime in the future.

Of course, nothing is stopping you from using apt-get interactively. I do. Maybe apt is easier to use interactively, but two commands are more difficult to learn then one command.

See also "What is the difference between apt and apt-get".

3
  • Thank you AlexP. Can you please clarify in the parenthesis level what do you mean by "interactively"? I could put both in a script and run the script (parenthesis block, script file, or heredoc) and both could use me to install something, so it is unclear to me to phrase "interactively" here...
    – user423047
    Apr 13, 2017 at 0:11
  • @Benia: Of course you can use both in scripts; but the developers say that for scripting you should use apt-get. The difference is that apt-get is guaranteed to remain compatible, that is, newer versions will not change their output or their behavior, whereas apt is not -- newer versions may introduce changes. apt also is supposed to be easier to use. Of course, in reality people who would benefit from apt's supposed ease of use will prefer graphical utilities...
    – AlexP
    Apr 13, 2017 at 10:06
  • "Of course, in reality people who would benefit from apt's supposed ease of use will prefer graphical utilities..." Guess I'm an unreal person, then...
    – fkraiem
    Apr 13, 2017 at 11:40

You must log in to answer this question.