I'm new to Ubuntu and I'm going through the official documentation. Can someone explain why the command sudo apt-get install -y boot-repair && boot-repair
lists "boot-repair" twice?
Asked
Active
Viewed 898 times
5

Gabriel Fair
- 203
1 Answers
13
The last line contains two commands.
The first part installs boot-repair
. (sudo apt-get install -y boot-repair
)
The "&&" characters is a delimiter like ";" is, however its conditional on success, ie. the command following it is only to be run IF the first command had no errors.
The 'second' boot-repair
is the one that runs it.

guiverc
- 30,396
-
If you used a ";" and the install command worked; the result would be the same as it'd install, then run. If however the install failed you'd get errors for the install failing, followed by more errors as
boot-repair
couldn't be found... The && conditional parameters reduces the errors (if they occur) as they [errors] can scare users (what did i do wrong? did i break it?..) – guiverc Feb 20 '18 at 01:40 -
1oh of course, that makes sense. Thank you. I was thinking that it was trying to install it twice. – Gabriel Fair Feb 20 '18 at 01:50
boot-repair
is twice as important as the other commands (joke) – Baldrickk Feb 20 '18 at 11:57