Personally, I think sites list them one by one just for clarity. It's easier to run one at a time and understand what it does then it is to run, say 3, all at once.
I might point out too, not all sites do list commands one by one. For example, in the OMG Ubuntu article on installing Unity Tweak Tool the commands are listed as:
sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily
sudo apt-get update && sudo apt-get install unity-tweak-tool
It's also worth noting that
&& will only run the second or third (etc) command if the command before it returns exit status
0. In other words, the command after
&& will only be run if the command before
&& completes successfully.
If you'd like your string of commands to execute one by one no matter if any fail you would separate each command with
; instead of
&&. For example:
sudo add-apt-repository ppa:[ppa-address] ; sudo apt-get update ; sudo apt-get install [application-name]
(Of course, this wouldn't be a good thing to do when installing packages!)
There are a number of reasons why an
apt command would fail:
apt-get install could fail for quite a few reasons, among them dependency issues, not enough disk space, no internet connection, or an old or malformed
apt-get update could fail for similar reasons, a malformed
sources.list, no internet connection, a 404 PPA, etc.
These are just some of the things that would cause
apt to fail, causing commands after
&& to not be run.