172

I am using Ubuntu 12.04 right now. If I use the command sudo apt-get dist-upgrade will that upgrade my Ubuntu to 12.10? Does that mean I won't be using the LTS version after that? I don't want to use Ubuntu 12.10 because I've already tried it and it's very heavy for my netbook.

0

4 Answers 4

188

You can read the man-page of apt-get to see what each command do.

Open the manual

man apt-get

Find the section dist-upgrade and read

dist-upgrade

       in addition to performing the function of upgrade,
       also intelligently handles changing dependencies with new versions
       of packages; apt-get has a "smart" conflict resolution system, and
       it will attempt to upgrade the most important packages at the
       expense of less important ones if necessary. So, dist-upgrade
       command may remove some packages. The /etc/apt/sources.list file
       contains a list of locations from which to retrieve desired package
       files. See also apt_preferences(5) for a mechanism for overriding
       the general settings for individual packages

See also: What is “dist-upgrade” and why does it upgrade more than “upgrade”?

In order to upgrade Ubuntu to a newer release you have to run in terminal

sudo do-release-upgrade

We read from the man-page

man do-release-upgrade

DESCRIPTION

Upgrade the operating system to the latest release from the command-line. This is the preferred command if the machine has no graphic environment or if the machine is to be upgraded over a remote connection

3
  • 13
    I'd love a TL;DR; too, though Sep 6, 2016 at 15:02
  • 2
    If you prefer a nice GUI, use: sudo do-release-upgrade -f GTK
    – Tim Visee
    Sep 16, 2019 at 11:42
  • 1
    TL;DR; No it won't Feb 6, 2022 at 15:07
99

No, sudo apt-get dist-upgrade will not upgrade to a new Ubuntu release. It will just install available updates for the Ubuntu release you already have installed.

Unlike sudo apt-get upgrade it may install new packages or remove installed packages if that is necessary to satisfy dependencies. So be careful when using it.

5
  • what do you mean by remove installed packages? why it remove installed packages? So how suppose I use dist-upgrade?
    – albilaga
    Nov 10, 2012 at 5:36
  • 2
    It may remove a package if there's a conflict between packages or dependencies that can't be satisfied. Usually you don't need to use dist-upgrade. It may be useful if upgrade tells you that some packages are hold back, but you should carefully review what it wants to do, especially if it want to remove packages. Nov 10, 2012 at 5:51
  • I'll claim this answer is false. If the /etc/apt/sources.list* has been altered to point to a new release, then apt-get dist-ugprade indeed will (attempt to) upgrade to a new release. Not something that is likely to happen to a casual user, though. Dec 11, 2018 at 15:16
  • 1
    @PeterV.Mørch In fact, the do-release-upgrade tool does exactly that: update the contents of /etc/apt/sources.list, disables or modifies the extras in /etc/apt/sources.list.d/ and then calls apt-get dist-upgrade. Aug 7, 2020 at 15:09
  • I think the concepts are inverted. Jun 4, 2022 at 16:08
10

If you do not want to upgrade to non-LTS versions, follow these steps:

  • Open Ubuntu Software Center.

  • Go to Edit -> Software Sources.

  • Go to the Updates tab and make sure you have selected For long-term support versions in the Notify of a new Ubuntu version.

enter image description here

  • Open a terminal and run sudo apt-get update (just to be sure :) ).

  • Now, when you run sudo apt-get dist-upgrade it'd be upgraded to the next LTS version and not non-LTS versions.

3
  • In Ubuntu 16 this program is called Software & Updates
    – Underverse
    Sep 10, 2017 at 10:47
  • 1
    How do you do this operation from the command line?
    – Dan Pritts
    Feb 6, 2018 at 4:13
  • From command line: software-properties-gtk
    – foolo
    Jul 7, 2020 at 12:54
8

you cannot jump from 12.04 to 13.04 directly you would have to have update manger set to normal then do

sudo apt-get dist-upgrade

or

sudo do-release-upgrade

the difference between the commands is that dist-upgrade wants you to change your config files during the upgrade

they both will upgrade your dist when the time comes sudo apt-get upgrade only upgrades the software on your system it does not install or remove packages like dist-upgrade.

1
  • 2
    If you are running an alternative desktop like cinnamon or mate and you run do-release upgrade it will remove cinnamon and keep the config files and your system will break cause it's looking for cinnamon and it's not there if you ran dist-upgrade it will change the config files system will remove cinnamon and system will use gnome 3 instead you would have reinstall the desktop after doing the upgrade though
    – user112609
    Dec 4, 2012 at 13:26

Not the answer you're looking for? Browse other questions tagged .