6

Today XKCD posted this shell script:

install.sh

Alt-text:

The failures usually don't hurt anything, and if it installs several versions, it increases the chance that one of them is right. (Note: The 'yes' command and '2>/dev/null' are recommended additions.)

Would using such a script which tries all kinds of possible installation methods until it finds one which works be a good idea?


Bonus question: could you think of any additional installation methods which should be added to this script?

dr_
  • 28,763
  • 21
  • 89
  • 133
Philipp
  • 179
  • 8
  • 5
    Not really, no, but it's hilarious. – frostschutz Mar 11 '16 at 11:41
  • 1. Love xkcd and What If? 2. Mixed use of sudo implies non root installation otherwise. 3. Would chain commands in the foreground with || 4. Cross-OS scripts/utilities are a noble effort / idea, but a long-term pain. 5. Still love xkcd :) – Jeff Schaller Mar 11 '16 at 12:00
  • 8
    Ugh, how did this get closed? It is **important** that people know not to take this script seriously, because running it is **a terrible idea**. – Kyle Strand Mar 11 '16 at 18:11
  • @KyleStrand Feel free to vote to reopen. It takes 5 votes to reopen, or a mods intervention. – Faheem Mitha Mar 11 '16 at 23:51
  • 1
    @FaheemMitha I would, but I have about 200 rep. That is not sufficient. – Kyle Strand Mar 12 '16 at 00:26

1 Answers1

10

A good rule of thumb is to not take web cartoons seriously. They are intended to amuse and divert. No disrespect intended to the worthy Mr. Munroe.

Automating installations except under very specific circumstances is never a good idea. Even if you know what system it is, all sorts of things can go wrong. (A case when it is relatively reasonable is routine upgrades for Debian stable.)

Also, I would not recommend local installs, from git repositories or otherwise, unless a binary package for your distribution is unavailable. Even then, (as @case pointed out), you can try to build a package which can then be installed with the distro's package management tools. e.g. using the various debhelper tools in debian such as dh-make-perl, python-stdeb, dh-dry etc. Also, these days it is not that difficult to build one's own package from scratch using with the help of tools like dh-make.

Additionally, a script like the one shown could possibly do multiple local installs of the same package, which would make a mess.

A script such as the above would perhaps not be quite so unreasonable if it was configured to abort on a successful binary installation, but such a script would be much more complex, and would not fit neatly in a web cartoon.

Faheem Mitha
  • 34,649
  • 32
  • 119
  • 183