Tuesday, May 17, 2016

upgrade - One single command to update everything in Ubuntu?


I know that there are three command to update and then upgrade the whole system, these are:




  • sudo apt-get update # Fetches the list of available updates

  • sudo apt-get upgrade # Strictly upgrades the current packages

  • sudo apt-get dist-upgrade # Installs updates (new ones)



Is there a super-upgrade command that combines all these commands to one?



There are 3 decent choices:



  1. You could create a script something like the following:


    #!/bin/bash
    set -e
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade

    Call it something like update.sh and place it in /usr/local/bin and then make the script executable by running:


    sudo chmod +x /usr/local/bin/update.sh

  2. Another method would be to create a bash alias (in ~/.bashrc) or wherever you normally store your aliases:


    alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade'

  3. A final method would be to simply string the 3 commands together on the commandline:


    sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade


A few choices...


Reference:


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...