r/linuxquestions • • May 22 '26

Support Difference between apt update and apt-get update

Yesterday I had a computer science exam. One of the questions asked: "Which command installs the most recent versions of the programs installed on Linux?" None of the answer choices included anything related to upgrade all of them referred to update. My professor stated that the correct answer was apt-get update, and that the difference between apt update and apt-get update was that apt only searches for updates, whereas apt-get installs new versions of programs. The entire class disagreed, but he insisted. What is the actual difference between these commands, and is my professor mistaken?

313 Upvotes

200 comments sorted by

90

u/SportTawk May 22 '26

I want to know what your professor said about these answers and comments, please update us all, or should I say, sudo apt update 😁 is all!

46

u/ovelx2 May 22 '26

I just brought it up right now, I said the question was wrong and I showed him the Ubuntu manual where it states that update doesn't download or install anything, and the teacher dodged the question by saying that update doesn't install, but rather "downloads" to avoid having to explain why the question was poorly worded. If you're curious, the exact question was:

Which Linux command installs new versions of installed programs?

A. apt update

B. apt-get update

C. apt update --all

D. Update-all"

136

u/MoobyTheGoldenSock May 22 '26 edited May 23 '26

The apt update and apt-get update commands don't download packages. That would be apt upgrade --download-only or apt-get upgrade --download-only. Apt(-get) update just synchronizes the package databases. The only thing it downloads is a list of packages, not the packages themselves.

Why is your professor teaching this class if he doesn't know what the hell he's talking about?

→ More replies (22)

20

u/pnlrogue1 May 22 '26

He didn't dodge anything. He's flat-out wrong about part of his answer to you and the question itself explicitly asks about installing updates and none of those commands do that.

This is a silly question anyway because that's not a Linux command - it's a command for the apt package manager which is only generally used on Debian-based distributions. Ask him to try any of those commands on Fedora/Red Hat or Arch. At least apt[-get] update will do something on Debian/Ubuntu/Mint/etc but Red Hat and Arch based distros, amongst others, will simply fail as they use different package managers entirely.

28

u/vacri May 22 '26

'update' in apt terminology means "fetch me the package lists, so I can see if there are any new versions"

'upgrade' in apt terminology means "I will install packages from the lists that have higher version numbers than what is currently installed"

14

u/LameBMX May 22 '26

none of those work for me?

emerge world -u

thats the trick.

really, the prof of comp science shouldn't be using Debian specific stuff as examples under a generic "linux" header. pretty sure redhat is still a solid force in his students future world if they go the *nix route.

→ More replies (1)

11

u/soopastar May 22 '26

that is sooo bad. update just does that - updates the package details available to the sytem. upgrade is the way to install updates. thats just...wow.

→ More replies (1)

7

u/MajesticDisaster3977 May 23 '26

Your prof is teaching you something important. There are lots of people who don't know what they're talking about and forget that the manual page exists.

→ More replies (7)
→ More replies (3)

206

u/[deleted] May 22 '26

91

u/5141121 May 22 '26

They also only work on debian based systems . Saying "in Linux" ignores all of the other package management systems out there.

→ More replies (5)
→ More replies (14)

33

u/[deleted] May 22 '26

28

u/ovelx2 May 22 '26

I have seen him multiple times asking chatgpt to make exercices for us sooo...

19

u/radiowave911 May 22 '26

Ah, now we see the root of the problem. AI doesn't have a clue, either :D

I definitely have concerns over that professor's abilities and understanding of the subject they are teaching.

→ More replies (3)
→ More replies (1)
→ More replies (2)

129

u/ipsirc May 22 '26

Your prof is wrong. apt is the new refactored version of old apt-get, which goal is to be more interactive. So the thumb rule is to use apt in interactive terminals, and use apt-get in (shell) scripts. But the old skool Debian devops still use apt-get and apt-cache for everything... (apt merges the functionality of apt-get and apt-cache) Apart from this they do the same under the hood when you call them with update parameter: refreshing lists in /var/lib/apt/lists .

One example on well polished apt:

apt-get update && apt-get upgrade can be replaced with only one apt command: apt --update upgrade

8

u/punkwalrus May 22 '26

Wait, really? it's not working for me. That would have blown my mind; I have been using Debian since the 1990s.

user@server21:~/code/ansible$ sudo apt --update upgrade

[sudo] password for user:

E: Command line option --update is not understood in combination with the other options

This is on Ubuntu 22.04, which is fairly recent. sudo apt update && sudo apt upgrade still works, tho.

15

u/paperclip422 May 22 '26

I'm afraid it's 4 years old. Looks like the option works on Ubuntu 24.04

→ More replies (4)
→ More replies (2)
→ More replies (6)

46

u/blktndr May 22 '26

Also apt is not the “update Linux” command. First off: it’s Debian-specific. Second, it wouldn’t take into account any binaries that were installed by alternate means.
I don’t think the person who asked that question in the first place really understands what they are doing. I hope you aren’t paying them to teach you.

10

u/radiowave911 May 22 '26

I hope you aren’t paying them to teach you.

And if you are, I hope you can get a refund. While I am comfortable with, and have a preference for, Debian (and the derivatives thereof), I am not going to pretend that nothing else exists. Debian is Linux, but that does not mean that Linux is Debian.

→ More replies (1)

10

u/michaelpaoli May 22 '26

Your professor is wrong. I might suggest you (and your classmates) take the evidence to the prof on that, and if that doesn't fix that matter, take it up the chain.

apt update and apt-get update are equivalent, they differ only in their output formatting. apt-get is intended more for scripting and consistent output format, whereas apt is intended to be more human-friendly for interactive use, and the output format may also change.

And update has apt[-get] fetch fresh package database information - essentially updates its information on what's available. It's upgrade (or full-upgrade or dist-upgrade) that's actually used to upgrade the package(s) to newer versions.

Anyway, maybe also point the prof at your posting here, and the comments, etc. Also really not hard to run the tests/checks and see the results ... and even more so if one has VM(s) and can snapshot, so can return to earlier state and rerun again, and see what if any differences one gets starting from an earlier known and consistent state.

Yeah, annoying when instructors/professors get stuff wrong ... but sometimes they do.

25

u/-Sa-Kage- May 22 '26

If you are paying for this, consider reporting to your dean. Because when he is wrong about something this obvious, he might be wrong about other stuff, that might not be instantly obvious to you, as well.

16

u/B1G-J0E May 22 '26

You should report him to the department chair. The dean may not have any clue who the instructor is.

→ More replies (1)

13

u/sukuiido May 22 '26

Not only is your professor wrong today, that would never have been the correct answer. apt-get update only ever updated version information from the repositories to determine which packages had an upgrade available. That command has never downloaded and installed the actual upgrades for those packages.

15

u/Unlix May 22 '26

It sounds like your Prof was rather trying to explain the difference between apt-get update and apt-get upgrade, but something got mixed up.

→ More replies (1)

7

u/DinTaiFung May 22 '26

The professor might be able to save face by offering to the class a heartfelt mea culpa as well as a big TIL and thanks to the students for helping him to learn.

Only the great teachers are thrilled when a student surpasses the teacher.

→ More replies (5)

5

u/eR2eiweo May 22 '26

There is no major functional difference between them.

There are some smaller differences. IIRC: apt-get update doesn't use color by default. If a repo's release information changes, apt-get update will exit with an error but apt update will ask the user what to do. And if after the update there are packages that can be upgraded, apt update will show how many such packages there are, but apt-get update doesn't do that.