If that's the game we're gonna play:
yay
If that's the game we're gonna play:
yay
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
I don't get it. Looks like a script that runs all these things, but I don't get the one dollar.
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.
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?
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.
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.
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
Yes. At the beginning I preferred distro's specifically with a graphical software manager. Now i force uninstall it and use terminal for anything.
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
Ok now that's pretty good. Can we use this with dist-upgrade/full-upgrade?
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).
I also like graphical frontends because there I can see screenshots of the software, because there's a lot of software out there with really bad UI and UX.
Unless you use openSUSE Tumbleweed, right? Then itβs βsudo zypper dupβ, from what Iβve heard.
Flatpaks and snaps are two examples of deliverables with terribad integration and low SLSA scores. They should be considered toxic.
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.
Let's look at the alternatives:
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
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
Donβt forget
flatpak update
topgrade -y
Underrated. We usually have a lot more to upgrade than just the main distro's package manager.
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.
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.
nix flake update && nixos-rebuild switch --flake .
Or nh os switch
Non of those.
sudo zypper dup
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?"
pacman can list all packages and their description, then you just grep for key words
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.
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
I love it when a program says theirs a new version, would you like to download? pffffftt.
pacman -S [program name]
Aren't you supposed to do apt full-upgrade instead of apt upgrade?
Also wtf is pkcon for?
I actually like Mint's software center
ujust update
I use Bazzite BTW
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
sudo nixos-rebuild switch --flake path
(Or just my nswitch [path] script with a file-backed path cache)
Sudo dnf up
Downright quicker than opening a software center.
And it gives me the illusion of being some sort of super user
sudo apt update && sudo apt upgrade -y && sudo flatpak update -y
flatpak is only "flatpak update -y" from what i remember
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
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.
Fedora recommends using the software center rather than and in order to get more reliable updates.
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
TIL what dnf is finally.
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
Yes... until I started using Fedora Silverblue and now I use software center, but only occasionally because the flatpaks update themselves in the background.
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
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
}
top 96 comments