nDarkness Logo
  • Home
  • Forums
6 Nov 2009

Linux System Update Script



In my experience with Linux distributions, Slackware and Ubuntu/Kubuntu, there are a couple of different methods used to update the system. Of course we can always use a gui to do the updates but what fun is that?

The two commands used to update a Debian based system are:

safety@nDarkness:~/bin$ sudo apt-get update; sudo apt-get upgrade

Now while this doesn’t require a great deal of typing, let’s see if we can shorten it to suit our needs.

If you do not already have somewhere to store your personal scripts, the following command will do this for you and allow you to enter the code we will use:

safety@nDarkness:~$ mkdir bin; cd bin; vi apt-auto

Press i for insert and create the following script:

#!/bin/bash

sudo apt-get update; sudo apt-get upgrade

This is all we need to type for our script to produce the results we are looking for. Now let’s save our script by pressing Esc => :wq => .

To run our script we can type:

safety@nDarkness:~/bin$ bash ./apt-auto

You should see the output from the two commands used in the script printed to the screen. Now let’s make our script executable so we don’t have to type bash to make it run.

The following command will accomplish what we are looking for:

safety@nDarkness:~/bin$ chmod +x apt-auto

Now to run our command we simply need to type:

safety@nDarkness:~/bin$ ./apt-auto

We now have a working script to do our update process and it is significantly shorter than the first option we used. As always all comments are welcomed.

GHTime Code(s): 47bd7 nc 
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Tags: Linux, Slackware, Software, Ubuntu

This entry was posted on Friday, November 6th, 2009 at 9:07 pm and is filed under Linux, Utilities. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Click here to cancel reply.

CAPTCHA Image CAPTCHA Audio
Refresh Image
« Microsoft Exchange Recovery Mode and How to Fix it
Windows XP – Reclaim Lost Hard Drive Space »
  • nDarkness Recent Posts

    • Mac OS X – Update PHP, MySQL and Easily Add GD Support
    • Facebook’s Privacy Troubles on the Horizon
    • Should MySpace Be Put Out to Pasture?
    • WordPress Sites Hacked in Bulk
    • Intuit QuickBooks Discount Error Goes Unfixed
    • DM-FileManager 3.9.9 XSS Vulnerability
    • DM-FileManager 3.9.6 Cookie Injection and Authorization Bypass Vulnerability
    • Windows XP Roaming Profile Synchronization Issues
    • Windows XP – Reclaim Lost Hard Drive Space
    • Linux System Update Script
  • Sponsors


  • Recent Comments

    • Jacob on Facebook’s Privacy Troubles on the Horizon
    • Sid on Intuit QuickBooks Discount Error Goes Unfixed
    • safety on Intuit QuickBooks Discount Error Goes Unfixed
    • sid on Intuit QuickBooks Discount Error Goes Unfixed
    • safety on Intuit QuickBooks Discount Error Goes Unfixed
    • rafalbo on Intuit QuickBooks Discount Error Goes Unfixed
    • safety on Should MySpace Be Put Out to Pasture?
    • wclax04 on Should MySpace Be Put Out to Pasture?
    • safety on Intuit QuickBooks Discount Error Goes Unfixed
    • kgermino on Intuit QuickBooks Discount Error Goes Unfixed
  • User Recent Posts

    • Mandi has posted - Teaching My Baby Sign Language
    • Mandi has posted - Weekend Fun and CJ's Birthday
    • Mandi has posted - The Do's and Don'ts of Tipping
    • Mandi has posted - First Words
    • Cassey has posted - My New Toy
  • Categories

    • Account information (1)
    • Computer Security (6)
    • Linux (3)
    • Mac OS X (5)
    • Privacy (6)
    • Social Networking (2)
    • Software (4)
    • Uncategorized (1)
    • Utilities (4)
    • Windows (6)
  • Archives

    • May 2010 (5)
    • January 2010 (1)
    • December 2009 (1)
    • November 2009 (4)
    • October 2009 (6)
  • Site Links

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Tags

    Cookie Injection DM-Albums DM-FileManager Error Exchange Exploit Facebook Flash Flash Cookies Hacking Intuit Linux Mac MacBook MacBook Pro MySpace MySQL OS X PHP Privacy QuickBooks Service Slackware Social Networking Software Sprint Ubuntu Vulnerability Windows WordPress XP XSS
nDarkness is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
Privacy Policy