Announcement

Collapse
No announcement yet.

How to order commands? update, upgrade, etc.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to order commands? update, upgrade, etc.

    .
    How to order commands? update, upgrade, etc.
    For a one line,
    what order should these four (4) commands be in?

    Code:
    sudo apt update
    sudo apt list --upgradeable
    sudo apt dist-upgrade --fix-missing
    sudo apt autoremove --purge


    Below is a Terminal One Liner for
    Kubuntu 22.04.1 LTS (Jammy Jellyfish)

    Code:
    sudo apt update;\
    sudo apt list --upgradeable;\
    sudo apt dist-upgrade --fix-missing;\
    sudo apt autoremove --purge;

    What additional commands would make the above upgrade more complete?


    --​

    #2
    To use apt, you need "full-upgrade" not "dist-upgrade"

    Not sure why you would do "apt list --upgradeable" if you're just going to upgrade anyway. I can't think of anything I would add.

    What I did was use bash aliases so I could upgrade from the command line using one word:

    Code:
    alias update='sudo apt update; sudo apt list --upgradable'
    alias upgrade='sudo apt full-upgrade'
    ​

    Please Read Me

    Comment


      #3
      And if you only want a one-word command, create the alias as: alias upgrade="sudo apt update; sudo apt list --upgradeable; sudo apt full-upgrade"

      Then, from a konsole, you only have to type: upgrade
      Using Kubuntu Linux since March 23, 2007
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        To expand on oshunluvrr's comments, the only necessary commands are apt update and apt full-upgrade

        apt autoremove is fine, but really only needs to be run some of the time. It does not harm anything in running it often. to be sure.
        Autoremove mostly comes into play after uninstalling software, or after kernel updates, to remove any older kernel packages. Usually the last 3 versions are kept, and a regular autoremove will make sure older kernel and header packages are removed.

        The '--fix-missing;' (apt -f install) is a method to attempt to fix things -- it attempts to install packages that that did not get installed in the last run for some reason, were interrupted etc. It is useless to run, unless something failed, and the issue has been fixed.

        Comment


          #5
          I usually run
          Code:
          sudo apt update && sudo apt upgrade -y
          the -y mostly when I'm lazy (confirms Yes)
          And the occasional apt autoremove when necessary.

          Since none mentioned this maybe this method is obsolete?
          It works for me anyhow.
          ASUS M4A87TD | AMD Ph II x6 | 12 GB ram | MSI GeForce GTX 560 Ti (448 Cuda cores)
          Kubuntu 12.04 KDE 4.9.x (x86_64) - Debian "Squeeze" KDE 4.(5x) (x86_64)
          Acer TimelineX 4820 TG | intel i3 | 4 GB ram| ATI Radeon HD 5600
          Kubuntu 12.10 KDE 4.10 (x86_64) - OpenSUSE 12.3 KDE 4.10 (x86_64)
          - Officially free from windoze since 11 dec 2009
          >>>>>>>>>>>> Support KFN <<<<<<<<<<<<<

          Comment


            #6
            Originally posted by Jonas View Post
            I usually run
            Code:
            sudo apt update && sudo apt upgrade -y
            the -y mostly when I'm lazy (confirms Yes)
            And the occasional apt autoremove when necessary.

            Since none mentioned this maybe this method is obsolete?
            It works for me anyhow.
            You do want to use full-upgrade, as in some case using just 'upgrade' will not install everything. full-upgrade i s analogous to the older dist-upgrade
            While it is not a common and everyday occurrence, it is something that happens often enough to be a concern. this is different from how it is is done in Debian, though with the changes from apt-get to apt, the differences are much less these days.

            The main difference between upgrade and full-upgrade is that the latter can remove a package if necessary, while the former cannot.
            Sometimes, there is a new dependency that requires an old one be removed, so there are no conflicts. So, using plain 'upgrade' will eventually lead to one not getting all the updates at some point down the line.




            TMI Time:

            Theoretical:
            Plasma 8.14 needs LibFooBar3. The new Plasma 8.14.1 needs a security fix that requires a new thing, LibNewFoo, which replaces the old and buggy LibFooBar3 .
            LibNewFoo is marked to replace/conflict with LibFooBar3 -- ie LibFooBar3 would be uninstalled when LibNewFoo is installed, as desired

            If you use simply apt upgrade, LibNewFoo can't be installed, as it wants to uninstall LibFooBar3. So anything that depends on LibNewFoo won't get installed at all -- such as most or all of the Plasma 8.14.1 updates.


            This is precisely why neon decided promote using Pkcon on the command line, as the command used is less confusing, even though it performs the same action ( it is actually using apt under the hood, even), and they go as far as to patch the apt command to deliver a message about this when using apt upgrade instead of running this incorrect usage.

            Comment


              #7

              Please explain the 2 words, kept back


              The following packages have been kept back:
              libnss-systemd libpam-systemd libspeechd2 libsystemd0 libudev1 systemd systemd-sysv systemd-times
              yncd udev



              kept back appears after running a one liner with full-upgrade :
              Code:
              ​
              sudo apt update;sudo apt list --upgradeable;sudo apt full-upgrade --fix-missing;sudo apt autoremove --purge;


              How come above full-upgrade says kept back ?
              What is actually happening?
              Is there anything i can do so there are no files kept back ?

              --

              Comment


                #8
                IMO one-liners are overrated compared to just running commands one after the other, in a script if they're run often. (Though I must admit to not taking this advice often.)
                Regards, John Little

                Comment


                  #9
                  Originally posted by joseph22 View Post
                  Please explain the 2 words, kept back


                  The following packages have been kept back:
                  libnss-systemd libpam-systemd libspeechd2 libsystemd0 libudev1 systemd systemd-sysv systemd-times
                  yncd udev



                  kept back appears after running a one liner with full-upgrade :
                  Code:
                  ​
                  sudo apt update;sudo apt list --upgradeable;sudo apt full-upgrade --fix-missing;sudo apt autoremove --purge;


                  How come above full-upgrade says kept back ?
                  What is actually happening?
                  Is there anything i can do so there are no files kept back ?

                  --
                  beginning in 21.10 Ubuntu started using a new feature of apt for Phased Updates. Some updates will only go out to a small random portion of people at first. Then they will be released to the general public some days later if there are no issues.

                  People who normally update using Discover or other GUI tools simply never see this sort of messaging.


                  However, this message could also indicate other general issues as well, such as packages missing due to temporary connection issues with one of the repos or something like that. Or you have broken dependencies for some reason, though that would usually have other clear errors as well. You'd have to look at the whole output for relevant clues to be sure.

                  List of current packages being phased (may not always be up to date)
                  https://people.canonical.com/~ubuntu...d-updates.html

                  Bypass the phased updates if you really want to and the terminal output still annoys you that much even if you know what it means. 🤪:
                  https://askubuntu.com/questions/1421...phased-updates
                  Last edited by claydoh; Sep 26, 2022, 06:58 AM.

                  Comment


                    #10
                    IIRC, I've noticed the "held back" message when there are more than one version of a package available AND one is doing an full-upgrade of multiple packages. In those case, re-issuing the apt full-upgrade command usually results in the remaining held-back package being installed. I've never really dug into this as it doesn't occur very often.

                    As far as "upgrade" vs. "full-upgrade" I believe the lack of understanding the difference and the occasional problem being caused by using the former rather than the latter was part of the reason they introduced "pkcon"

                    Please Read Me

                    Comment


                      #11
                      Originally posted by oshunluvr View Post
                      As far as "upgrade" vs. "full-upgrade" I believe the lack of understanding the difference and the occasional problem being caused by using the former rather than the latter was part of the reason they introduced "pkcon"
                      At the time, it seemed like it was far more than an occasional issue , with many people not accustomed to either the differences between Ubuntu's and Debian's usage of apt, but also more likely not being used to the more constant set of updates that would make this sort of situation statistically a bit more likely to occur when using the 'wrong' apt switch.
                      Many reports started coming in of folks not getting updates, still being stuck on the previous Plasma version, and broken deps. All from using plain 'upgrade'. So they (Probably Harald, I bet ) took a small hammer to things lol.
                      of course the downside is that there are those who will squeal at you if you suggest using apt in Neon, even for troubleshooting and informational purposes. I sometimes remember to mention this when doing so.

                      I do find it kinda neat that packagekit does allow one to update a variety of different distro platforms using the exact same commands, Shame that its terminal output is so crap sometimes.
                      I don't use it myself, mind you....

                      Comment


                        #12
                        One annoyance is it seems that networkd is the default network renderer but pkcon doesn't work unless you change to NetworkManager.

                        Seems like a bug to me...

                        Please Read Me

                        Comment


                          #13
                          Originally posted by oshunluvr View Post
                          One annoyance is it seems that networkd is the default network renderer but pkcon doesn't work unless you change to NetworkManager.

                          Seems like a bug to me...
                          Huh?
                          worksforme
                          I am assuming i am using networkmanager, I definitely did not change anything involving the network stack from the default Neon install on my system (installed in June)


                          I am definitely using Network Manager, though I have upgrade to the 22.04 base.
                          Is yours a clean install?
                          Last edited by claydoh; Sep 26, 2022, 08:57 AM.

                          Comment


                            #14
                            Originally posted by claydoh View Post
                            I am definitely using Network Manager, though I have upgrade to the 22.04 base.
                            Is yours a clean install?
                            No upgraded from 18.04-20.04-22.04

                            I read on line the networkd was supposed to be the default. Maybe it was in the past, but not now. IIRC I uninstalled NetworkManager a long time ago because it wouldn't behave. It kept messing with my network connections without my input. I was also unable to get my bridged/aggregated connection setup - too complicated using NM. To be fair, that was several years ago and I haven't bothered to try it again. This is a desktop machine and my network connections are static and wired. I don't need a "manager", lol

                            Please Read Me

                            Comment


                              #15
                              I think on server install networkd might be the default? I dunno.
                              My 22.04 VM has NM as the default as well.

                              My newly built Openmediavault NAS server thingy (Debian) is using networkd for sure.

                              Comment

                              Working...
                              X