SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2008-12-11 14:42:40

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,057
Website

New system update script

I noticed a discussion in another thread about the lack of any system update tool for CrunchBang. Personally I have always used a combination APT commands to keep my system up-to-date, but I am aware that not everyone is comfortable with this method. Anyhow, I thought I would have an attempt at writing a wrapper script for APT to make the process of performing system updates a bit easier.

What I came up with is a script which can be run from both interactive (Terminator) and non-interactive (dmenu or Openbox's menu) shells. The command to run the script is system-update. The script also accepts a few arguments, run system-update --help to get the list.

I have packaged the script and it is available from CrunchBang's repository. Anyone wishing to test it can install it with the following command:

sudo apt-get update && sudo apt-get install crunchbang-system-update

Once the package is installed, as well as running the script via the terminal, and/or via dmenu/Openbox menu etc, it might be an idea to create a crontab entry so as to run it on scheduled basis. If you are not familiar with cron, there is a fairly good howto available at: http://crunchbang.org/archives/2007/10/ … ntab-file/

The update command could also be included in Openbox's autostart file at ~/.config/openbox/autostart.sh

# Wait a few minutes to establish a net connection
# and then perform a system update.
(sleep 180s && system-update) &

Anyhow, I hope this helps someone. If you have any feedback or suggestions for improvements, please leave them below. All are welcome. smile

Offline

Help fund CrunchBang, donate to the project!

#2 2008-12-11 15:25:10

michaelramm
The Inquisitor
From: Northport, AL USA
Registered: 2008-11-30
Posts: 175
Website

Re: New system update script

corenominal wrote:

I noticed a discussion in another thread about the lack of any system update tool for CrunchBang. Personally I have always used a combination APT commands to keep my system up-to-date, but I am aware that not everyone is comfortable with this method. Anyhow, I thought I would have an attempt at writing a wrapper script for APT to make the process of performing system updates a bit easier.

What I came up with is a script which can be run from both interactive (Terminator) and non-interactive (dmenu or Openbox's menu) shells. The command to run the script is system-update. The script also accepts a few arguments, run system-update --help to get the list.

I have packaged the script and it is available from CrunchBang's repository. Anyone wishing to test it can install it with the following command:

sudo apt-get update && sudo apt-get install crunchbang-system-update

Once the package is installed, as well as running the script via the terminal, and/or via dmenu/Openbox menu etc. It might be an idea to create a crontab entry so as to run it on scheduled basis. If you are not familiar with cron, there is a fairly good howto available at: http://crunchbang.org/archives/2007/10/ … ntab-file/

The update command could also be included in Openbox's autostart file at ~/.config/autostart.sh

# Wait a few minutes to establish a net connection
# and then perform a system update.
(sleep 180s && system-update) &

Anyhow, I hope this helps someone. If you have any feedback or suggestions for improvements, please leave them below. All are welcome. smile

Is this something that could be linked into conky to see if updates are available? I know that with Arch (with their rolling releases), I had a script that would run pacman (Arch Pkg Mgr) and I could put that in conky to display 'up-to-date' or 'updates available'.

Might be an interesting project for some programmer types (of which I am not one!)

Michael


The 1-Man IT Department | Ubuntu User #16666 | Linux User #451972
My Social Nets: Identi.ca | twitter | friendfeed
Crunchbangin' and Loving Every Minute of IT!

Offline

#3 2008-12-11 15:56:48

arpbook
The Mac Magician
From: montpellier,france
Registered: 2008-11-27
Posts: 177
Website

Re: New system update script

hi corenominal ,
the script works fine. put on autostart, just installed on a fresh new virtual-cblite, 3mn after reboot, terminator ask for update. all works fine. thanks smile


arpbook is dead - arpinux is born, and became a deviant.

Offline

#4 2008-12-11 16:30:35

./karlos
Member
From: Eastbourne UK
Registered: 2008-11-29
Posts: 25

Re: New system update script

The update command could also be included in Openbox's autostart file at ~/.config/autostart.sh

did you mean  ~/.config/openbox/autostart.sh ?


registered linux user #413097 | _/\o_ | CHANT: Hare Krishna, Hare Rama... AND BE HAPPY

Offline

#5 2008-12-11 16:33:31

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,057
Website

Re: New system update script

./karlos wrote:

did you mean  ~/.config/openbox/autostart.sh ?

Yes, that is exactly what I meant. Good catch! big_smile

Offline

#6 2008-12-11 16:37:53

./karlos
Member
From: Eastbourne UK
Registered: 2008-11-29
Posts: 25

Re: New system update script

no probs... nice script by the way... thanks


registered linux user #413097 | _/\o_ | CHANT: Hare Krishna, Hare Rama... AND BE HAPPY

Offline

#7 2008-12-13 09:37:59

./karlos
Member
From: Eastbourne UK
Registered: 2008-11-29
Posts: 25

Re: New system update script

I wasn't too keen on it firing up when I logged in so I made a menu entry...

<item label="System Update">
    <action name="Execute">
        <execute>
                        terminator --command=system-update
        </execute>
    </action>
</item>


registered linux user #413097 | _/\o_ | CHANT: Hare Krishna, Hare Rama... AND BE HAPPY

Offline

#8 2008-12-13 16:11:16

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,057
Website

Re: New system update script

^^ Good stuff. smile Note it is not necessary to call it via Terminator as the script should start Terminator itself. Give it a try, e.g.

<item label="System Update">
    <action name="Execute">
        <execute>
                        system-update
        </execute>
    </action>
</item>

Offline

#9 2008-12-13 16:21:32

./karlos
Member
From: Eastbourne UK
Registered: 2008-11-29
Posts: 25

Re: New system update script

ah yes... cheers... I added an -f to it while I was there...


registered linux user #413097 | _/\o_ | CHANT: Hare Krishna, Hare Rama... AND BE HAPPY

Offline

#10 2008-12-13 16:57:38

razienwolf
#! CrunchBanger
From: SP, Brasil
Registered: 2008-12-01
Posts: 115

Re: New system update script

Works quite well.

But what about the dist-upgrade? The kernel and stuff, its okay to update them?? Will be manually or can the script handle this too?

Offline

#11 2008-12-13 17:17:40

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,057
Website

Re: New system update script

Yes, the script can handle dist-upgrades with an optional argument. Here is the --help output:

corenominal@muppy:~$ system-update --help
Usage:
  -i, --interactive       run system update
  -n, --non-interactive   run system update and only prompt
                          for root password
  -f, --full              run full system update including
                          any Kernel upgrades
  -h, --help              show this message and exit

Offline

#12 2008-12-13 18:55:44

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: New system update script

Nice work, very nice smile I prefer to do it myself as well but this script will suit lots of people down to the ground smile

Offline

#13 2008-12-14 00:37:13

razienwolf
#! CrunchBanger
From: SP, Brasil
Registered: 2008-12-01
Posts: 115

Re: New system update script

Hehe nice. I guess I should have taken a look at the help =p What a lazy boy I am o.o
And since I'm lazy, gonna use this for when I dont want to type all the letters hehe.

Just kidding, nice script.

Offline

#14 2008-12-14 00:51:49

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: New system update script

corenominal wrote:

^^ Good stuff. smile Note it is not necessary to call it via Terminator as the script should start Terminator itself. Give it a try, e.g.

<item label="System Update">
    <action name="Execute">
        <execute>
                        system-update
        </execute>
    </action>
</item>

Well after saying I wouldn't use this much I now think it's quite handy smile I added another entry to my menu for a full dist-upgrade option as well

<item label="System Update-Full">
    <action name="Execute">
        <execute>
                 system-update -f
        </execute>
    </action>
</item>

Offline

#15 2008-12-30 07:32:59

crazybilly
#! Member
Registered: 2008-12-05
Posts: 73

Re: New system update script

michaelramm wrote:

Is this something that could be linked into conky to see if updates are available? I know that with Arch (with their rolling releases), I had a script that would run pacman (Arch Pkg Mgr) and I could put that in conky to display 'up-to-date' or 'updates available'.

You probably already found this, but here's a page that shows how to make updates and conky play nice together: http://forums.debian.net/viewtopic.php?t=33946.

I created a the script (called updates.sh) and then added it to my .conkyrc as per their recommendations.


Peaces, crazybilly

Offline

#16 2009-01-05 09:51:30

peterrus
Member
Registered: 2009-01-04
Posts: 11

Re: New system update script

If someone is looking for a graphical update notifier:

You could take a look at the following package: update-notifier
It is shipped by default in ubuntu/xubuntu and sits (invisible) in the system tray until updates trough apt-get are available, then the icon becomes visible and a balloon pop-ups. It runs as a normal user and thus does not compromise security.

Maybe something to ship per default in crunchbang?

Installing it goes as following:

$ sudo apt-get install update-notifier

now add the following in your autostart.sh file (somewhere around where the other applets like parcelite and network manager are started):

update-notifier &

Do not forget the ampersand (&) or the script will hang here forever and eternity. wink

Offline

#17 2009-01-05 15:24:31

kestrel
Species: F. sparverius
From: Moscow, Idaho
Registered: 2008-11-29
Posts: 170
Website

Re: New system update script

peterrus, thanks for this tip. I guess this is one of the advantages #! has by being built on top of Ubuntu. We get the advantages of their good work and still have the ease of use of Openbox.


My web activities: Etsy Shop | Facebook | Blog

Offline

#18 2009-01-05 15:57:54

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,057
Website

Re: New system update script

peterrus wrote:

If someone is looking for a graphical update notifier:

You could take a look at the following package: update-notifier

Hello peterrus smile

I would be interested to know how this works out for you. A previous version of CrunchBang did ship with the update-notifier, but problems arose due the lack of any official desktop metapackage. I am not sure if these issues still occur? Maybe I should install it and give it a try...hmm...

Thank you for raising this.

Offline

#19 2009-01-05 16:09:24

arpbook
The Mac Magician
From: montpellier,france
Registered: 2008-11-27
Posts: 177
Website

Re: New system update script

@corenominal
'update -notifier' woks perfectly until you try a dist-upgrade. 'cause we need the famous meta-pkg to run a dist-upgrade with ubuntu hmm


arpbook is dead - arpinux is born, and became a deviant.

Offline

#20 2009-01-05 16:19:40

kestrel
Species: F. sparverius
From: Moscow, Idaho
Registered: 2008-11-29
Posts: 170
Website

Re: New system update script

@arpbook,
Yes, Ive turned off "Release Upgrade" in the "Updates" tab of the "Repositories" menu in Synaptic. I think this will prevent me accidentally doing a dist-upgrade. Also added "Backports" which for some reason was not included.

So far update-manager is working. Updated cups, thunar, several XFCE packages and a few other misc packages this morning.

Last edited by kestrel (2009-01-05 16:25:58)


My web activities: Etsy Shop | Facebook | Blog

Offline

#21 2009-01-17 13:37:17

nitro-ale
Member
From: italia
Registered: 2009-01-15
Posts: 22

Re: New system update script

kestrel wrote:

@arpbook,
Yes, Ive turned off "Release Upgrade" in the "Updates" tab of the "Repositories" menu in Synaptic. I think this will prevent me accidentally doing a dist-upgrade. Also added "Backports" which for some reason was not included.

So far update-manager is working. Updated cups, thunar, several XFCE packages and a few other misc packages this morning.

i've turned off relase update too, but the script always says: you are going to perform a dist-upgrade!

Offline

#22 2009-02-06 20:35:04

matty
New Member
From: Sweden
Registered: 2009-01-12
Posts: 3

Re: New system update script

When I use

system-update

I get

Usage: terminator [options]
terminator: error: no such option: --upgrade
matty@AsusEee900:~$ Set Property to 0.75

but, it works with

sudo system-update

why? roll

Offline

#23 2009-02-06 20:48:11

snowpine
#!-a-roo
Registered: 2008-11-24
Posts: 2,922

Re: New system update script

matty wrote:

When I use

system-update

I get

Usage: terminator [options]
terminator: error: no such option: --upgrade
matty@AsusEee900:~$ Set Property to 0.75

but, it works with

sudo system-update

why? roll

"sudo" gives you temporary superuser or root privileges, which is required for potentially serious tasks, like updating the system.


/hugged

Offline

#24 2009-02-06 20:54:09

matty
New Member
From: Sweden
Registered: 2009-01-12
Posts: 3

Re: New system update script

snowpine wrote:
matty wrote:

When I use

system-update

I get

Usage: terminator [options]
terminator: error: no such option: --upgrade
matty@AsusEee900:~$ Set Property to 0.75

but, it works with

sudo system-update

why? roll

"sudo" gives you temporary superuser or root privileges, which is required for potentially serious tasks, like updating the system.

So, I need to change this in the "rightclick-menu"?!
Strange, it worked before...

Offline

Be excellent to each other!

#25 2009-02-06 21:12:36

michaelramm
The Inquisitor
From: Northport, AL USA
Registered: 2008-11-30
Posts: 175
Website

Re: New system update script

My openbox menu entry is be

terminator --command=system-update

Then you authenticate when you start the update process.

Michael

Last edited by michaelramm (2009-02-06 21:12:52)


The 1-Man IT Department | Ubuntu User #16666 | Linux User #451972
My Social Nets: Identi.ca | twitter | friendfeed
Crunchbangin' and Loving Every Minute of IT!

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo