Rule (sh.itjust.works)
submitted 2 months ago by to c/linuxmemes@lemmy.world
 

top 96 comments

sorted by: hot top controversial new old
[–] 51 points 2 months ago (5 children)

If that's the game we're gonna play:

yay

  • source
  • hideshow 5 child comments
  • [–] 28 points 2 months ago (10 children)
  • [–] 3 points 2 months ago (2 children)

    Never thought about it, but wouldn't that just fail after the first one it fails to find? I think most install commands return nonzero if nothing is installed

    Should probably use or instead of and

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 2 months ago (5 children)

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

  • source
  • parent
  • hideshow 5 child comments
  • [–] 5 points 2 months ago (4 children)

    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.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 2 months ago (3 children)

    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?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 7 points 2 months ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 6 points 2 months ago

    If you run it with arg1, won't it run them all?

    Yes, that is the intention. When you're following some guide online and it requires you use some "software", you may not know how to install that software.

    This install.sh script tries package managers, because one of them will probably work. Others will fail.

    For example, installing numpy (python package): pip install succeeds and all the other ones (hopefully) fail.

    Installing libcurl4-openssl-dev (curl with openssl library file): apt-get install works and all other ones (hopefully) fails.

    Longer and more thorough explanation:

    https://www.explainxkcd.com/wiki/index.php/1654:_Universal_Install_Script

  • source
  • parent
  • [–] 25 points 2 months ago (3 children)

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

  • source
  • hideshow 3 child comments
  • [–] 46 points 2 months ago (5 children)

    I'll keep making Debian users aware that they can do it all in one command since Trixie.

    sudo apt --update --autoremove --with-new-pkgs upgrade
    
  • source
  • hideshow 5 child comments
  • load more comments (1 reply)
    [–] 19 points 2 months ago (8 children)

    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).

  • source
  • hideshow 8 child comments
  • [–] 4 points 2 months ago (4 children)

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

  • source
  • parent
  • hideshow 4 child comments
  • [–] 11 points 2 months ago* (last edited 2 months 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.

  • source
  • parent
  • [–] 5 points 2 months ago (1 child)

    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.
  • source
  • parent
  • hideshow 1 child comment
  • [–] 17 points 2 months ago (3 children)

    The only time I use the software center is if im looking for software to do a job without already knowing the name of the program that would

  • source
  • hideshow 3 child comments
  • [–] 11 points 2 months ago* (last edited 2 months ago) (2 children)

    With Arch, if you have the Yay manager, you can do β€œyay ” and it’ll search not just the names of packages but the descriptions too. I’m sure there’s equivalents for other distros, and even with pacman itself

  • source
  • parent
  • hideshow 2 child comments
  • [–] 12 points 2 months ago (1 child)

    Don’t forget

    flatpak update
    
  • source
  • hideshow 1 child comment
  • [–] 11 points 2 months ago* (last edited 2 months ago) (3 children)
  • [–] 2 points 2 months ago (2 children)

    Underrated. We usually have a lot more to upgrade than just the main distro's package manager.

  • source
  • parent
  • hideshow 2 child comments
  • [–] -2 points 2 months ago (1 child)

    Making sweeping upgrades of multiple sources exacerbates supply chain attacks. Not making it easier solves ΓΎe wrong problem, but we're in an awkward time where we have a cornucopia of software and very few good, scalable means of keeping ΓΎe shitheads out.

    We mostly solved dependency hell, only to run into script kiddie repos attacks. I suppose as soon as we address ΓΎat, ΓΎe next problem will be how to keep ΓΎe slop out.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 2 months ago

    First off, downvoted for thorn.

    Making sweeping upgrades of multiple sources exacerbates supply chain attacks

    What else are you supposed to do? Not upgrade? The user most likely installed those packages/flatpaks/distroboxes for a reason, why would they not upgrade them?

    Sure, security can be improved. But no idea why topgrade deserves any blame here.

  • source
  • parent
  • [–] 9 points 2 months ago* (last edited 2 months ago) (1 child)

    nix flake update && nixos-rebuild switch --flake .

    Or nh os switch

  • source
  • hideshow 1 child comment
  • [–] 8 points 2 months ago (3 children)

    Non of those.

    sudo zypper dup

  • source
  • hideshow 3 child comments
  • [–] 8 points 2 months ago (4 children)

    I do both. If I know exactly what I want to install, I'll install it from the terminal because it's often more direct. If I go "I need an app that does thing, what's available?"

  • source
  • hideshow 4 child comments
  • [–] 1 point 2 months ago (3 children)

    pacman can list all packages and their description, then you just grep for key words

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 2 months ago (2 children)

    apt-search and dnf-search both exist. I have used both. I prefer a GUI for that because they'll provide things like screenshots, no CLI tool does, neither to TUI tools like Aptitude.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 2 months ago (1 child)

    I wasn't sure, the gui is nicer in some ways but defs less direct and given that you said "terminal is more direct" I thought you were using the gui because you hadn't made some simple helper scripts for searching the database quickly

  • source
  • parent
  • hideshow 1 child comment
  • [+] 8 points 2 months ago (1 child)
  • [–] 8 points 2 months ago

    I love it when a program says theirs a new version, would you like to download? pffffftt.

    pacman -S [program name]

  • source
  • [–] 8 points 2 months ago (2 children)

    Aren't you supposed to do apt full-upgrade instead of apt upgrade?

    Also wtf is pkcon for?

  • source
  • hideshow 2 child comments
  • [–] 8 points 2 months ago (1 child)

    I actually like Mint's software center

  • source
  • hideshow 1 child comment
  • [–] 7 points 2 months ago*
    > update
    

    (it's an alias)

  • source
  • [–] 7 points 2 months ago (1 child)

    ujust update

    I use Bazzite BTW

  • source
  • hideshow 1 child comment
  • [–] 1 point 2 months ago

    I use bazzite on my BC250 console but bazzite's package management is horrible lmao.

    It's good for something you install and never touch but not adequate for general purpose computing.

    Pacman is an amazing package manager, dnf is probably better but inertia has me prefer pacman. The rest suck

  • source
  • parent
  • [–] 6 points 2 months ago*

    sudo nixos-rebuild switch --flake path

    (Or just my nswitch [path] script with a file-backed path cache)

  • source
  • [–] 5 points 2 months ago* (last edited 2 months ago)

    Sudo dnf up

    Downright quicker than opening a software center.

    And it gives me the illusion of being some sort of super user

  • source
  • [–] 4 points 2 months ago (3 children)
    sudo apt update && sudo apt upgrade -y && sudo flatpak update -y
    
  • source
  • hideshow 3 child comments
  • [–] 3 points 2 months ago (2 children)

    flatpak is only "flatpak update -y" from what i remember

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 months ago

    I don't even install anymore I just do nix run. What I use daily is in my nix config, the rest can stay in the store

  • source
  • [–] 3 points 2 months ago (1 child)

    While I still tend to stick to the terminal for updating, I still have fond memories of doing everything through Synaptic Package Manager when I first got into Ubuntu in 2009.

  • source
  • hideshow 1 child comment
  • [–] 3 points 2 months ago (1 child)

    Fedora recommends using the software center rather than and in order to get more reliable updates.

  • source
  • hideshow 1 child comment
  • [–] 3 points 2 months ago

    I'm a pveupdate && pveupgrade guy myself

  • source
  • [–] 3 points 2 months ago (1 child)

    Am I the only one that always has to LOL when I think about how Red Hat tried so hard to push for modules to be a thing with DNF but then they decided to kill it off because nobody wanted to maintain it. lmao

  • source
  • hideshow 1 child comment
  • [–] 3 points 2 months ago (1 child)
  • [–] 2 points 2 months ago (1 child)
  • [–] 2 points 2 months ago

    Nah, just declare your packages programmatically

  • source
  • [–] 2 points 2 months ago* (last edited 2 months ago)

    or just put into your .bashrc

    alias update="sudo dnf up --assumeyes && sudo flatpak update --system --assumeyes && flatpak update --user --assumeyes"

    a lot more comfortable

  • source
  • [–] 2 points 2 months ago (1 child)

    Yes... until I started using Fedora Silverblue and now I use software center, but only occasionally because the flatpaks update themselves in the background.

  • source
  • hideshow 1 child comment
  • [–] 2 points 2 months ago

    Bazzite/Bluefin/Aurora do all updates in the background. Flatpak and Brew as well.

    So all you have to do is restart your computer on a regular basis and everything just works.

    It's what make them nice for people who use their computers like a Chromebook.

  • source
  • parent
  • [–] 2 points 2 months ago*

    Updating my shit in Termux:

    # update via apt wrapper
    pkg upgrade
    # update yt-dlp
    yt-dlp -U
    # update everything in ~/.src
    # (in this case, just ksh93)
    gr ~/.src
    cd ~/.src/ksh
    bin/package make
    bin/package install /data/data/com.termux/files/usr
    
  • source
  • [–] 2 points 2 months ago

    Duh. Why do you think I switched to Linux the moment I learned it existed

  • source
  • [–] 2 points 2 months ago (3 children)
    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
    }
    
  • source
  • hideshow 3 child comments
  • [–] 2 points 2 months ago

    Write that down

  • source
  • load more comments
    view more: next β€Ί