How To Quickie: Fast way to update your linux box

Updating your linux box is getting each time easier, you can wait until a new update message pops up on your taskbar, or update on your terminal. I usually use the terminal to update my computer, and I will let you know the way I do.

For a quick update, you can type on your terminal this commands:

  • sudo apt-get update
  • sudo apt-get upgrade -y
  • sudo apt-get autoremove
  • sudo apt-get autoclean

But it isn’t that handy, a bunch of code to type every time. You can create a new alias which will make all those codes at once, so it will be way faster!

Here is what you can do:

With graphical interface, Alt+F2:

    gedit .bashrc

In text mode, terminal:

    vim .bashrc

At the end of the file, add this line:

    alias update=’sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y autoremove && sudo apt-get -y autoclean’

Save the file, and type on the terminal

    source ~/.bashrc

Now the next time you want to update your system you just need to type “update” on the terminal and all will be updated.

Thanks for readying

Comments

  1. Why are you putting that in bashrc?I’d put the command string in a file named update, chmod x the file, then execute it from cron. You could also execute it manually. bashrc is a resource file (a config file if you will, for bash).It’s not a bash environment variable you are trying to set. This seems like a script, so make it a script. Alias directives are for things line aliasing ll to ls -l.

    Anyway, That was just a suggestion.
    I have quite a neat blog, I’m an avid reader.

    -Larry
    eMail me if want to reply.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.