Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Is there a sort of update tool for my Raspbian Wheezy package? I installed php and lighttpd and I want to keep those automatically updated for when bugs are found.

Thanks in advance.

share|improve this question

5 Answers 5

up vote 34 down vote accepted

You need to enter some commands into the command line. First of all:

apt-get update  

(this will update the sources of software)

apt-get upgrade  

(this will upgrade everything to the latest version)

share|improve this answer
    
Is that all ther's to it? Will it upgrade everyting i installed via apt-get, including the Os itself? –  Michel Jan 27 '13 at 21:33
1  
The "OS itself" being the linux kernel, yes. The first time you do this there will probably be a bunch of updates since the repository will usually contain newer packages than the install image. –  goldilocks Jan 27 '13 at 22:00
    
Everything that came from the apt repo, that is. Which is normally everything except your data, but might not include e.g. the kernel or bootloader in this case. If you've downloaded stuff from elsewhere or made some of your own, that obviously can't be automagically upgraded :) –  XTL Jan 28 '13 at 7:02
    
Yep, that's all there is to it. You might have to answer the occasional yes/no question for larger pieces of software, but basically, it's that easy. –  recantha Jan 28 '13 at 8:30
1  
@Michel : Sometimes "the linux OS" is more broadly referred to as "GNU/Linux" which would include the kernel ("linux" in the strict sense) and userspace fundamentals such as the C library, shell, etc, which are under the GNU umbrella. With windows, all these parts are immutably integrated, whereas the linux world is more heterogeneous and modular, so there can be some confusion. I would have taken "the OS" here to refer to the debian wheezy distro (including the kernel), but you seemed to be referring to something more specific. –  goldilocks Jan 28 '13 at 13:06

Dist:

 $ sudo apt-get update
 $ sudo apt-get upgrade 

Rpi-update first time: install git and certifications for reach github.

$ sudo apt-get install ca-certificates
$ sudo apt-get install git-core
$ sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
$ sudo chmod +x /usr/bin/rpi-update

update firmware

$ sudo rpi-update
$ sudo ldconfig
$ sudo reboot

Rpi-update after:

$ sudo rpi-update
$ sudo ldconfig
$ sudo reboot

rpi-update

share|improve this answer

The unattended-upgrades package is the way to automate updating the OS in these debian-family distributions. Follow instructions found in here.

Basically you have to install the package:

sudo apt-get install unattended-upgrades

and add to /etc/apt/apt.conf.d/10periodic the following:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

Additionally (since it seems like the porting of the package has not been flawless), change the following line at the first section of /etc/apt/apt.conf.d/50unattended-upgrades:

        "origin=Debian,archive=stable,label=Debian-Security";

to

//        "origin=Debian,archive=stable,label=Debian-Security";
        "origin=Raspbian";

Now your system keeps itself up-to-date automatically.

share|improve this answer
2  
The last step (swapping out origin=Debian) is no longer necessary in the latest distribution of Raspbian. –  Dolph Feb 9 at 17:25

You could also write a little script with your apt-get steps in there and run it on a schedule once a day / however often you like, that's what I've done.

How to set up a cron job on the Pi:

http://www.wexoo.net/20130406/running-cron-jobs-on-raspberry-pi-in-raspbmc

How to write a bash script:

https://www.linux.com/learn/tutorials/284789-writing-a-simple-bash-script-

My script was just a simple

apt-get update
apt-get upgrade -yes
apt-get dist-upgrade -yes
apt-get clean

and I had it logging the output to a file with >> at the end of each line, e.g. apt-get update >> autoupdate.txt.

It's debatable as to how good an idea it is to do this though!

share|improve this answer
    
Any chance you could share the script &/or info on how to do these timed events. I imagine if the OP knew how to do this, he wouldn't have posted. –  Phill Healey Dec 23 '13 at 11:05

rpi-update can now be fetched directly via apt-get, so there would be no need to deal with wget. So here is now the updated way:

Dist:

 $ sudo apt-get update
 $ sudo apt-get upgrade 

You need to reboot the raspberry pi now, otherwise the new kernel would not be used!

Rpi-update first time: install git and certifications to reach github.

$ sudo apt-get install ca-certificates
$ sudo apt-get install git-core
$ sudo apt-get install rpi-update

update firmware

$ sudo rpi-update
$ sudo reboot -r now

rpi-update

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.