On Archlinux it is not recommended to update only one package with the package manager pacman. Let’s say I have 11 packages, and one of them is extra/firefox (true story). Updating only a pacman -S firefox could introduce problems, but installing a new single package if it wasn’t there is okay.

So my question is, could we get around this by removing and installing the same package again in one go: pacman -Rs firefox && pacman -S firefox

  • A_norny_mousse@feddit.org
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    2 days ago

    but installing a new single package if it wasn’t there is okay.

    Not true. It says clearly “Partial upgrades are not supported”. Whether the package was there or not is irrelevant. And I really don’t mean this personally, but as general advice, using Archlinux and its wiki requires a modicum of independent thinking.


    edit: clarification:

    It is OK to use ‘-S’ only if all installed packages are on the same level as the local package info. That is assuming that the cached local version of the package is still available on package servers.

    Also read https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported

    • thingsiplay@beehaw.orgOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      2 days ago

      But -S package is not upgrading the package (Edit: I meant system). Installing with that command is supported. That is NOT a partial upgrade of the system. -Sy package is considered a partial upgrade, because that command updates the package list.

      And I really don’t mean this personally, but as general advice, using Archlinux and its wiki requires a modicum of independent thinking.

      This part was a total unnecessary attack, for someone who asks. Especially if you are not entirely correct.

      • A_norny_mousse@feddit.org
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        2 days ago

        It is OK to use ‘-S’ only if all installed packages are on the same level as the local package info. That is assuming that the cached local version of the package is still available on package servers.

        I just think you’re being too literal about this, instead of thinking about the reasoning behind that rule.

      • Strit@lemmy.linuxuserspace.show
        link
        fedilink
        arrow-up
        2
        ·
        2 days ago

        But -S package is not upgrading the package. Installing with that command is supported. That is NOT a partial upgrade of the system. -Sy package is considered a partial upgrade, because that command updates the package list.

        I disagree. The -S flag stands for “sync”, which means sync the local version with the remote version. So if there is no local version it just installs the remote version. This is still a partial update, because any dependencies it might have, that you already have installed, might be the wrong version compared to the one the newly installed package expects.

        pacman -S should be discouraged because of this. The correct one is pacman -Syu for installing new packages.

        • Aatube@kbin.melroy.org
          link
          fedilink
          arrow-up
          4
          ·
          2 days ago

          If you have not ran a database update (any y after -Sy), pacman will fetch the version that is compatible with your _ current_ installed dependencies.

          • Strit@lemmy.linuxuserspace.show
            link
            fedilink
            arrow-up
            2
            ·
            20 hours ago

            The remote server only has the latest version of the package, and the latest version is always built against the dependencies on the remote server. So if you didn’t update the database, then your pacman -S command will fail, because it can’t find the package version on the remote server. So you did not install anything.

        • thingsiplay@beehaw.orgOP
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          2 days ago

          No, pacman -S package is safe. Because the package list is not updated this way, and therefore the system is not updated and nothing else is affected. New packages can be installed with this command, perfectly okay. That is in the spirit of Archlinux.

          I think my idea would not work because the nature of the command -S package, as no new version would be synced. This is not a partial upgrade and it does not need to be discouraged.

          • Strit@lemmy.linuxuserspace.show
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            20 hours ago

            No, pacman -S package is safe. Because the package list is not updated this way, and therefore the system is not updated and nothing else is affected. New packages can be installed with this command, perfectly okay. That is in the spirit of Archlinux.

            If the package is not in your cache, it needs to download it from the remote server first. The version on the remote server is built against the dependencies on the remote server. So if your local dependency is older, it will be a partial update!

              • Strit@lemmy.linuxuserspace.show
                link
                fedilink
                arrow-up
                2
                ·
                20 hours ago

                And where does it download the newly installed package from? It’s not in your cache, because you haven’t had it installed before and the remote server only has the newest version.

                • Markaos@discuss.tchncs.de
                  link
                  fedilink
                  arrow-up
                  2
                  ·
                  14 hours ago

                  The download will simply fail if the version pacman wants to download isn’t available on the mirror. The version is part of the download URL.