Simplify rpi-update code.
Revert mirror change.  I prefer http.debian.net these days.
Merge the two apt-get calls and do not use install -y to give the user a choice before installing.