0

When do I run "apt-get update" on Ubuntu 18.04 LTS? Is it ever necessary under Long Term Support?

After reading the suggested duplicates I don't believe my question is a duplicate. I already know what apt-get update does, but that wasn't my question.

JWNWSA
  • 157
  • 11
  • 4
    Possible duplicate of [Why should I regularly run 'apt-get update' and similar commands?](https://askubuntu.com/questions/1036813/why-should-i-regularly-run-apt-get-update-and-similar-commands) (see [Melebius's answer](https://askubuntu.com/a/1036853/22949)) – Eliah Kagan Jul 23 '19 at 22:04

2 Answers2

1

If you have set System settings (icon in the Launcher) > Software and updates > / Updates \ > Automatically check for updates: to something else than "Never", then you shouldn't need to do anything from the command line.

$ sudo apt-get update will launch a process to check for available updates "now".
$ sudo apt-get upgrade will install the updates based on what was found.
$ sudo apt-get dist-upgrade simplified: if any packages were "held back" during the upgrade, this will install them.

For upgrade and dist-upgrade, and also anything install, remove or purge:
Do check thoroughly what it says before actually letting it to do its thing.
There MIGHT be surprises.

Links worth a look:
What does "sudo apt-get update" do?
https://askubuntu.com/a/694412/22949

Hannu
  • 4,968
  • 1
  • 23
  • 40
  • Beware: the `dist-upgrade` action [can also *remove* packages](https://askubuntu.com/a/694412/22949). – Eliah Kagan Jul 23 '19 at 22:08
  • 1
    I didn't downvote, but note that in some extreme cases `dist-upgrade` might not install all upgrades. Sometimes the reason why an upgrade is not installed by `upgrade` is that it cannot be installed, full stop (a common cause is an unsatisfiable dependency). – fkraiem Jul 25 '19 at 15:28
0

To answer your question quickly; right after a fresh install of the operating system, before installing software, after adding new repositories to install software, and as often as possible.

Gordster
  • 1,679
  • 11
  • 21