0

I am depending on running the following script (as an cronjob every week) for all my update of ubuntu focal fossa.

# To make the script exit upon error
set -e

# Now carry on with the update and upgrade
apt-get --assume-yes --fix-missing update
dpkg --configure -a
apt-get --assume-yes --fix-broken install
apt-get --assume-yes upgrade
apt-get --assume-yes dist-upgrade
apt-get --assume-yes full-upgrade
apt-get --assume-yes autoremove
apt-get --assume-yes clean

I just wonder, since it includes something like dist-upgrade and full-upgrade, does it mean my focal-fossa will be automatically updated to the more recent jellyfish version? If so, does it make Ubuntu a rolling distro, just like manjaro?

Della
  • 495
  • 4
  • 8
  • 19
  • 1
    No, it doesn't. – Pilot6 May 14 '22 at 09:53
  • 2
    Does this answer your question? [Will apt-get dist-upgrade upgrade my system to a newer version?](https://askubuntu.com/questions/215267/will-apt-get-dist-upgrade-upgrade-my-system-to-a-newer-version) – Pilot6 May 14 '22 at 09:54
  • 1
    *since it includes something like dist-upgrade and full-upgrade, does it mean my focal-fossa will be automatically updated to the more recent jellyfish version?* No, of course not, such information can be very easily googled, and those are redundant! This stems from a very poor understanding of what the commands do, lack of updated knowledge - use of the old `apt-get` instead of `apt` - and you don't depend on such "script" to keep the system updated, no one does. – ChanganAuto May 14 '22 at 10:00
  • You're using a *stable* system (ie. the second latest LTS release*. If you want a *rolling* system, Ubuntu can use *rolling rhino*, but you need to specifically select to use that, with the upgrade needing to be made from current *development* release which is *five* releases newer than your *focal*, ie. you upgrade to *rolling rhino* from *kinetic* (focal, gorilla, hirsute, impish, jammy, kinetic... you're a very old-stable system currently with focal) – guiverc May 14 '22 at 11:03
  • 1
    Automating repair (`--fix missing` and `--fix broken`) seems wasted effort: Apt cannot autofix network problems nor resolve breaks that are unwisely introduced by a human admin. Running both `dist-upgrade` and `full-upgrade` seems pointless. Pick the correct command and run it only when appropriate lest a human admin's mistake with sources devastate your system. – user535733 May 14 '22 at 13:37

1 Answers1

0

Your script will not upgrade to a different Ubuntu release. (Unless you modify your /etc/apt/sources.list)

For upgrading to a new release you have:

do-release-upgrade

See the Ubuntu man page for do-release-upgrade

You might want to use apt instead of apt-get. I think apt-get full-upgrade does not even exist.

sudo apt upgrade

Will upgrade your existing packages if it can without removing or adding packages (in case of a change in dependencies)

sudo apt full-upgrade

Will do everything that the normal upgrade command does, and additionally might remove/add packages if required in order to upgrade.

I believe the "sudo apt-get upgrade" is redundant in your script and can be removed. The "sudo apt-get full-upgrade" can be changed to "sudo apt full-upgrade", so the "sudo apt-get dist-upgrade" can be removed as well.

BootsyZ
  • 91
  • 1
  • 4
  • 1
    Nitpicking: the link refers to the `man` page of the `do-release-upgrade` command, where `man` stands for _manual_ (as in: handbook), not for _manage_. – Jos May 14 '22 at 10:29
  • Whoops, I typed this on my phone. Apparently "manpage" was autocorrected to manage. I'll edit, thanks :) – BootsyZ May 14 '22 at 13:08