• MsFlammkuchen@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        22
        ·
        1 day ago

        && executes the second command, if the command before was successful, || executes the second command if the first one was unsuccessful and ; executes the second command regardless of success.

        • ITGuyLevi@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          20 hours ago

          I may be totally confused but I’ve also always done it in that order, otherwise I feel like it would run upgrades from your cache of the apt repos (possibly hitting errors as stuff likes to change), then after it would run apt update (updating the repos).

          My thought has always been update repos, then check those repos for software upgrades. I could definitely be wrong though.

            • ITGuyLevi@programming.dev
              link
              fedilink
              arrow-up
              3
              ·
              3 hours ago

              Yeah but shouldn’t the order matter? My understanding was that && just said 'after the previous command, run this… ’ so running upgrade before update would miss any changes changes to repos… From what I can tell update is required before upgrade (just like you have it), doing it in reverse missed a ton of updates for me.

              • reggu@lemmy.world
                link
                fedilink
                arrow-up
                2
                ·
                1 hour ago

                If it were upgrade && update, yes that would miss the boat. --update is a baked in feature of apt upgrade, so it knows what to do ^_^

    • Cevilia (she/they/…)@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 day ago

      I’m absolutely serious.

      You can also add a package name to install it at the same time as doing the upgrade, though personally I prefer to do that as a separate command so I can see what dependencies are needed.