3

What is the difference between the command line sudo apt-get update and the command line sudo apt update?

Although I've been using only Ubuntu and Ubuntu-based distros in the last several years, I still consider myself an entry-level user when it comes about command lines and Terminal-related stuff. I mention this aspect because I need a novice-friendly explanation.

A bit of background info: on a regular basis I run the commands sudo apt-get update and sudo apt-get upgrade in my Terminal. And I also know that it is recommended to do so before installing any app, in order to avoid any errors.

But today I have decided to install snapd on my Ubuntu 14.04 system, and I noticed that, on their webpage there are mentioned these two lines:

sudo apt update sudo apt install snapd

And this is why I am puzzled. (By the way, these lines work fine in my case.)

fkraiem
  • 12,555
  • 4
  • 35
  • 40
  • @pomsky - I mean exactly the difference between "sudo apt-get update" and "sudo apt update". – Cristiana Nicolae Sep 09 '18 at 12:10
  • Link given by DK Bose got you covered. "apt" is a newer frontend to the debian APT tools than apt-get. You will not have apt available in 14.04 – vanadium Sep 09 '18 at 12:11
  • apt is there in 14.04 as well: http://manpages.ubuntu.com/manpages/trusty/en/man8/apt.8.html but I don't know if it has the features available in later versions of Ubuntu. – DK Bose Sep 09 '18 at 12:17
  • 1
    run it and see. for the most part it's the same, but with pretty colors & for some functions a cute status graph, but it's still missing some functionality, and until it has all functionality included, you'll still have the old apt-get installed for when you need those features. sudo apt-get dist-upgrade is now sudo apt full-upgrade, but dist-upgrade still works in apt (even if not in man apt; maybe it'll go when apt-get is finally depreciated? (if that ever happens)) – guiverc Sep 09 '18 at 12:36
  • But see https://askubuntu.com/a/926850/248158 because, by default, apt install doesn't retain debs in /var/cache/apt whereas apt-get install does by default. – DK Bose Sep 09 '18 at 12:53
  • @pomsky - Yes, I did. Thank you for the correction! – Cristiana Nicolae Sep 09 '18 at 13:29

1 Answers1

0

Apt is the new frontend. More specifically apt offers the same more-or-less functionalities as apt-get, apt-cache etc in a single command. You can read more about the differencies and similarities here: https://itsfoss.com/apt-vs-apt-get-difference/

J.Snow
  • 44
  • 1
    Thank you! The information from the link you provided explains things in a more clear way that the information I got from the other links (including the other AU similar question). It is exactly like I asked: novice-friendly. – Cristiana Nicolae Sep 09 '18 at 13:46