r/linuxquestions • u/ovelx2 • 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?
206
May 22 '26
→ More replies (14)91
u/5141121 May 22 '26
They also only work on
. Saying "in Linux" ignores all of the other package management systems out there. debian based systems → More replies (5)
33
May 22 '26
→ More replies (2)28
u/ovelx2 May 22 '26
I have seen him multiple times asking chatgpt to make exercices for us sooo...
→ More replies (1)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)
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
→ More replies (6)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 optionsThis is on Ubuntu 22.04, which is fairly recent.
sudo apt update && sudo apt upgradestill works, tho.→ More replies (2)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)
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.
→ More replies (1)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.
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.
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!