Hacker News new | past | comments | ask | show | jobs | submit login

What does this mean if you run a Debian server?

Will "apt update && apt upgrade" update to 10.6 or do you need to put out a heavier gun?




Yes, that will work. As part of running `apt upgrade`, the package base-files will get upgraded from 10.3+deb10u5 to 10.3+deb10u6 which will update /etc/debian_version to say 10.6 instead of 10.5.


Yes, but I would recommend to use `apt --with-new-pkgs upgrade` to avoid packages being held back. See also https://superuser.com/a/1453944/13234.


Should do it, I like to include a dist-upgrade at the end to do additional tidying if dependencies have changed dramatically.


Is there a difference between doing "apt upgrade" followed by "apt dist-upgrade" vs only doing "apt dist-upgrade"?


The man page is many times better than me at explaining it:

       upgrade
           upgrade is used to install the newest versions of all packages
           currently installed on the system from the sources enumerated in
           /etc/apt/sources.list. Packages currently installed with new
           versions available are retrieved and upgraded; under no
           circumstances are currently installed packages removed, or packages
           not already installed retrieved and installed. New versions of
           currently installed packages that cannot be upgraded without
           changing the install status of another package will be left at
           their current version. An update must be performed first so that
           apt-get knows that new versions of packages are available.

       dist-upgrade
           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. The dist-upgrade
           command may therefore 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.


There should not be.

The distinction is that "dist-upgrade" is willing to remove packages and "upgrade" is not, on the grounds that outdated packages are common for major version upgrades but not otherwise. So I could imagine a situation where there's a new conflict, and "upgrade" resolves it by finding a different alternative instead of installing something that would conflict, and if you run "dist-upgrade" after "upgrade" it finds that the conflict was already resolved, but that seems rare/unlikely.

Personally I just use "dist-upgrade" always and pay attention to the command line - it tells you pretty clearly if it's going to remove something.


dist-upgrade is more likely to break things because it can uninstall packages. So it's sometimes useful to run a plain upgrade first just so there will be fewer packages in the dist-upgrade. This lets you review the dist-upgrade output closer and perhaps decide to cancel it if you need to make some changes before it's safe to run. If you are going to ignore the output or just run with -y, there's no reason to split them.


That should do it




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: