Bosse_B
Posts: 834
Joined: Thu Jan 30, 2014 9:53 am

When and how to upgrade?

Tue Feb 10, 2015 3:34 pm

I bought a PiB (512 MB RAM) about 10 months ago in order to set it up as an OpenVPN server.
I installed Raspbian on it and it has worked very well for VPN since last spring.
Now I want to expand its use so I can connect a webcam to it and use it as a burglar alarm.
Reading some websites on this and they seem to suggest that I should do an operating system upgrade before I start with the webcam stuff.

So now I wonder what will happen if I do:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
Will this load an operating system update that makes the VPN server functions stop working?
Could I keep the RaspBian from last spring even if I want to run motion on it?
(sudo apt-get install motion is what it takes according to how-to pages).

I am not very up-to-date as to what will be brought along when one makes an operating system upgrade...
Bo Berglund
Sweden

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: When and how to upgrade?

Tue Feb 10, 2015 5:02 pm

Normally you should do the update/upgrade when there is a security issue effecting something you use (ssh/openvpn/etc) and before installing new software. The former is rare, and the latter may not be needed, though things change regularly enough that an update is normally needed before installing a package. Upgrading is normally safe but can sometimes crash your system and prevent it from booting. Ubuntu offers a safe-upgrade option, but that's not used in raspbian, so backup on the unlikely but possible chance it trashes your software. For me upgrading raspbian was stable for years (after the initial SD card bug was fixed) then last week It broke in a bad way. So yah (1) backup (2) close all running applications and services, (3) use nice:

Code: Select all

sudo nice apt-get update && sudo nice apt-get upgrade
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Bosse_B
Posts: 834
Joined: Thu Jan 30, 2014 9:53 am

Re: When and how to upgrade?

Tue Feb 10, 2015 5:32 pm

Thanks!
I have never done a backup on any of my 3 Pi's...
How does one do that? Seems like something one should do. Is a target network drive or such needed?

And what is the nice command? Never saw that either....
Bo Berglund
Sweden

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: When and how to upgrade?

Tue Feb 10, 2015 5:57 pm

Some reading:
nice
man
I backup the majority of my data separately from the OS with rsync, but if you are using the pi for just openvpn, you don't need that.
More backup tools I use that you likely don't need but may find interesting:
rsync
rdiff-backup
duplicity
git
git-annex
rtorrent

I don't bother backing up to OS much, instead I keep install scripts so re-installing is normally a one click operation. If there are dramatic OS changes (device tree overlay, systemd) more work is required either way.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Bosse_B
Posts: 834
Joined: Thu Jan 30, 2014 9:53 am

Re: When and how to upgrade?

Tue Feb 10, 2015 6:24 pm

I had a look at the Pi documentation for backup and unfortunately I don't really understand it...
Specifically, if I would like to make a full SD-card image backup like described in the end, it looks like I have to do it from another system?
I assume that they mean:
- shut down the Pi
- remove the SD-card
- Mount it on another Linux system
- Run the disk imaging command
In my case I have to mount it on my Win7 PC and use Win32DiskImager to create the image, I guess
I really would like to have a full backup of the complete installation if something starts going bad.
I logged on to the Pi with Putty and issued "sudo shutdown now".
THe PuTTY session was cancelled as expected but the LEDs on the Pi never seemed to go off so in the end I pulled the power on it...
Hope that nothing broke.
Now imaging with Win32DiskImager.
After that is done I will do a Raspbian upgrade and go from there.

---EDIT---
Took quite a while to image the SD-card and then do the Raspbian upgrade. Now done.
Seems like my OpenVPN server is still OK though so that part is good still.
I still have an issue with a startup time when printing (the Pi is my print server via CUPS), which I hoped would be solved by the upgrade. Seems not.
The connection to the printer server from my Win7 machine always seems to take about 25-30 seconds for some strange reason. Repeat connections are done in 2 s or so...
For another thread, I guess.
Bo Berglund
Sweden

Return to “Raspbian”