upgrade vs. dist-upgrade, apt vs. apt-get

Discussion in 'General' started by muekno, May 17, 2020.

  1. muekno

    muekno Member HowtoForge Supporter

    Searching the internet I found recommendations to use dist-upgrade. ISPconfig also tells me that there are updates available if upgrade says something held back until I run dist-upgrade. Also on the net i found recommendations to use apt instead of apt-get, at least I understood it so. i'm actually running Debian 10 on most of my servers and Debian 9 on some others.
    Maybe that is a silly question, but if not I would like an answer or link from the specialist here.
    Thanks, hope you are all doing well in that times.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    In what situation? There is update, dist-upgrade and full-upgrade. They do different things, one is good in one situation, other in other places.
    The apt command is newer, but it does same things as apt-get and apt-cache. Some users like there is only one command, those who got used to having both apt-get and apt-cache may continue using those.
    There is, of course, documentation available for those commands. It is easily found in Debian Documentation of all places: https://www.debian.org/doc/manuals/debian-faq/pkgtools.en.html#apt-get
    Even Wikipedia has article: https://en.wikipedia.org/wiki/APT_(software)
    Typing your question in topic to Internet Search Engines finds useful looking articles.
     
  3. muekno

    muekno Member HowtoForge Supporter

    Thats what I did, read some of the articles including wiki. Exactly these answers led me to this post.
    "
    All I primary want is to keep my ISPconfig servers up to date. So I check the Monitor at least once a week and update them when ISPconfig shows updates available. Normaly apt-get update && apt-get upgrade. Sometimes apt-get dist-upgrade is necessary, mostly when there is a new kernel. In addition I installed "needrestart" showing me services to restart or if I have to reboot. In finding out the differences between upgrade and dist-upgrade I found the apt instead apt-get. A little bit confused, having similar commands doing similar things I ask here, what is the best solution for my ISPconfig servers.
    Thanks
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What criteria do you use for evaluating this bestness?
    Starting with Debian Jessie, some frequently used apt-get and apt-cache commands have an equivalent via the new apt binary.
    The apt tool merges functionality of apt-get and apt-cache and by default has a fancier colored output format, making it more pleasant for humans. For usage in scripts or advanced use cases, apt-get is still preferable or needed.

    To upgrade all the packages on your system, and, if needed for a package upgrade, installing extra packages or removing packages, run:

    apt full-upgrade

    (The command upgrade keeps a package at its installed obsolete version if upgrading would need an extra package to be installed, for a new dependency to be satisfied. The full-upgrade command is less conservative.)
    The dist-upgrade is for upgrading from Stretch to Buster, for example. Or from Debian Buster to the next Debian release.
    To keep my Debian server updated, I install package unattended-upgrades. Then I run full-upgrade if some packages must be removed or added.
     
  5. muekno

    muekno Member HowtoForge Supporter

    Thank you for explanation, so I did it wrong all the years when using dist-upgrade. So I wonder why I never got a new major version, not o Debian 8 or 9. I think because of I did not change the content of /etc/apt/sources.list. To get a new major Version I installed a new server as i moved from 32bit to 64bit. Some of the Debian 10 server I did an inplace update following some tutorial.
    So apt full-upgrade will be the solution for me.
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    To what problem?
    Note, that if you run a production server apt update is most safe, since it does not remove any packages, nor install any packages that were not installed previously. That full-upgrade can mess the server if some application depends on a package that got removed.
     

Share This Page