• electric_nan@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      8 days ago

      I don’t get it. Looks like a script that runs all these things, but I don’t get the one dollar.

      • FlexibleToast@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days ago

        The $1 is a positional variable. So if you run ./script.sh arg1 $1 would be arg1 in that example, $0 would be the ./script.sh. It’s the simplest way to pass an argument to a script.

        • electric_nan@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          8 days ago

          So… huh? What role does this play, since all the lines in the picture have $1? If you run it with arg1, won’t it run them all? And if you left out arg1 and also didn’t add $1 to each line, wouldn’t it also just run all of them?

          • Captain Aggravated@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            0
            ·
            8 days ago

            So the joke is, you’ve got something you want to install, be it a Python module, Java library, steam game, desktop application, whatever. You want it installed, figuring out which package manager has it and remembering the exact command syntax starts getting to be a pain, so just use this script to try installing it from a variety of sources.

            You would evoke it by running ./install.sh package and it will replace all instances of $1 with the string “package” at runtime. The ampersand at the end of each line will run that line as a separate background process rather than in the foreground process, so effectively this will attempt to install “package” or whatever you put in as an argument from a half dozen sources simultaneously in parallel.

            These include the old and new Python package managers, the old and new Red Hat package managers, debian/Ubuntu’s APT with and without sudo, cloning a git repo and building from source, and the icing on the cake is curling directly into bash.

            Don’t curl directly into bash. You’ll catch genital rabies.

            Remember that this is an XKCD comic, it’s a joke. The alt-text says “The failures usually don’t hurt anything and if it installs multiple versions it increases the chance one of them is right. (the ‘yes’ command and ‘2>/dev/null’ are recommended additions.)” “Yes” is a bash command that will spam ‘y’ in the terminal, the point of it is to answer yes to any questions an automated system asks, and 2>/dev/null will stop it from displaying errors. These add an even deeper level of Yolo-ing.

  • WillieShen@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago
    update_pm() {
      sudo apt update
      sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      sudo DEBIAN_FRONTEND=noninteractive apt autoremove -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      echo y | sudo ubuntu-drivers install || true
      sudo apt install -f -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      echo y | sudo ubuntu-drivers install || true
      sudo apt install -f -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      echo y | sudo ubuntu-drivers install || true
      sudo apt install -f -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      echo y | sudo ubuntu-drivers autoinstall || true
      sudo apt install -f -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      echo y | sudo ubuntu-drivers autoinstall || true
      sudo apt install -f -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      echo y | sudo ubuntu-drivers autoinstall || true
      sudo apt install -f -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      sudo DEBIAN_FRONTEND=noninteractive apt autoremove -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite"
      sudo apt clean
      sudo apt autoclean
      flatpak update -y || true
      flatpak uninstall --unused -y || true
      sudo snap refresh || true
      brew update
      echo y | brew upgrade
      echo y | brew autoremove
      brew cleanup
      uv self update
      uv tool upgrade --all
      npm i -g npm
      npm update -g
    }
    
  • chronicledmonocle@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    There is nothing wrong with using your distro’s app center. Often it will save you extra steps by updating things like Flatpaks as well, if you use them (or Snaps, if you’re an insane person).

    • corsicanguppy@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      Flatpaks and snaps are two examples of deliverables with terribad integration and low SLSA scores. They should be considered toxic.

      • mholiv@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        8 days ago

        Snaps I agree just because there is no open source snap store and it’s impossible to set up a 3rd party store.

        Flatpaks though? They let people install packages with weird / rare / not available requirements on any distro. All open source with a really nice sandbox. I think flatpaks are great.

      • hirihit640@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 days ago

        Let’s look at the alternatives:

        • System packages: not viable for the majority of packages because the distro devs don’t have time to manually package everything
        • AppImage: even worse integration (like no desktop shortcuts on install). Developer has to guess what libraries need to be included and which ones are already installed by the user. No sandboxing. Probably worse SLSA scores.
        • AUR: even worse security. No sandboxing. Packages are often compromised by hackers.
  • tumbling4986@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    Yes. At the beginning I preferred distro’s specifically with a graphical software manager. Now i force uninstall it and use terminal for anything.

    • DarkSirrush@piefed.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 days ago

      I was annoyed when i discovered cachyos used paru.

      I understand defaulting to prompting a code review is a good idea, especially now, but i was very used to typing yay (yes I installed yay instead of making an alias)