Upgrading Ubuntu to 10.04 quickly

Ubuntu provides a fairly fool proof way to upgrade from one version to the next but it can take literally hours – when I upgraded my netbook from 9.10 it took just over 4 hours.

The reason for this is that ubuntu’s update-manager downloads everything. What’s worse is if you want to upgrade from a version earlier than 9.10 you must upgrade one release at a time.

Now I’ve got one machine that’s running 8.10, so I’ve got to upgrade to 9.04 first, then 9.10 before I can upgrade to 10.04. If it’s going to take 4 hours a piece then that’s 12 hours at least.

So how can you speed things up if you have either a slow connection or if you have to do multiple upgrades?

Well there’s two ways, the first is to upgrade from scratch – however that’s not viable if you are upgrading a configured machine that gets heavy usage.

The other is to use the alternative iso’s and upgrade from there.

So for that machine running 8.10, I need to download the 9.04, 9.10 and 10.04 alternative iso’s, in this case the for the i386 platform.

Here’s some links to those iso’s:

Version alternate iso
Homepage i386 amd64
9.04 http://releases.ubuntu.com/releases/9.04/ ubuntu-9.04-alternate-i386.iso ubuntu-9.04-alternate-amd64.iso
9.10 http://releases.ubuntu.com/releases/9.10/ ubuntu-9.10-alternate-i386.iso ubuntu-9.10-alternate-amd64.iso
10.04 http://releases.ubuntu.com/releases/10.04/ ubuntu-10.04-alternate-i386.iso ubuntu-10.04-alternate-amd64.iso

Now for the upgrade process. Either burn each iso to disk, or mount it locally and run the upgrade.

peter@kodos:~$ sudo mount -o loop ubuntu-9.04-alternate-i386.iso /media/cdrom0

Ubuntu should show the upgrade dialog, however if it doesn’t – or you are doing this over an ssh connection then you can start it manually – just remember to use -Y with the ssh command 😉

peter@kang:~$ ssh -Y kodos
peter@kodos:~$ sudo mount -o loop ubuntu-9.04-alternate-i386.iso /media/cdrom0
peter@kodos:~$ gksu "sh /cdrom/cdromupgrade"

You must do this for each step and you can’t skip any of them.

Tip: It will prompt you to check for updates during the procedure. Unless you are upgrading to the latest version, or the intermediate steps (9.04, 9.10 etc) you can safely say no here. This will actually save you a lot of time downloading updates only to wipe them out with the next upgrade.

I found that going from 8.10 to 9.04 took about an hour, but 9.04 to 9.10 just half an hour – a big saving.

Update 2010-05-05: If you are remotely updating a server (i.e. does not have desktop installed) then you can’t use gksu as above. Instead use:

peter@kang:~$ ssh kodos
peter@kodos:~$ sudo mount -o loop ubuntu-9.04-alternate-i386.iso /media/cdrom0
peter@kodos:~$ sudo /cdrom/cdromupgrade

Nikkai A88JB FreeView PVR

Maplin currently have some special offers on at the moment and one of them is the Nikkai A88JB USB PVR Digital TV Receiver for £39.99. Now I wasn’t really in the market for a new receiver but what caught my eye was that, unlike other standalone Freeview boxes with a card slot or usb port, this one supposedly records onto an external HD connected to the USB port – so I thought I’d give it a try.

First the manual – what crap. It looks like it’s a photocopy of some original written in the usual pigeon english you’d expect of something mass made in China.

As for the unit, it doesn’t look that well built with three buttons on the front (Power, Channel Up and Down) and a display showing the time when in standby or the channel number. On the right hand side there’s a cover which when opened shows the SD/MMC slot and the USB port.

View of the unit sitting on top of my old PS2.

The white cable is plugged in to the USB port and connects an old USB Harddrive to the unit.

Once plugged in it runs relatively well. Scanning for channels is quick and when in use it’s a lot more responsive than my existing Freeview box (built into the TV).(a lot quicker than the one I’ve been using) and the user interface is not the best I’ve seen – I’ve seen better with units far cheaper than this one, but at least it works.Now apparently it has text support but I can’t get that to work, and you cannot record radio (no big deal there), but the main thing is the recording of programs.

Recording live TV is simple, just press REC and it records. To stop you’d have thought you would press the stop button next to it but no, it’s press REC again then confirm by pressing left and Enter – 3 button presses when there’s a button next to it!

Playback from the unit appears fine as well, but the timer is sheer crap. You can only program in up to 8 timers and you can set them with the date, time and channel and if it occurs once, every day, week or year (why?). It takes me back to programming VHS recorders twenty years ago.

So, now begs the question – can the recordings be played back on the Mac?

Well, the files are stored on the HD as .mpg files and they are readable. However Quicktime doesn’t recognise it (this is with Perian installed). Not looking good so far. I then tried Media Player 10 that I have installed inside VMWare and again no go. Media Player plays the audio but could not find a video codec.

Not wanting to give up on 40 quid I then turned to good old Open Source.

So I fired up VideoLan and tried playing the recorded program – presto it works.

A test recording being played with VLC on Mac OSX10.5

Now if VideoLan works on the Mac then will it work with Linux? Yep even on Linux it will play a recording 🙂

A test recording being played with VLC running on Ubuntu 8.10

So all in all it seems that it might be a decent unit. The timers could do with some work, and it looks ugly with the USB cable showing from the front (no rear USB port), but it might be a good buy – we’ll see.

I’m going to set it up to record some shows during the next week (ones on whilst I’m at work) and see how it performs, so expect an update next week.

Finding the process id of the process owning a port

Occasionally there’s time where you need to find out what process owns a port currently open.

On the Mac this can be done easily by using the following line – here we are looking for port 8080:

ps u –no-heading -p  `netstat -nlept | awk ‘/[:]8080 / {split ($9,t,”/”); print t[1]}’` 2>/dev/null

For windows you don’t have a decent shell (and cygwin would probably not work here), so you can use the following batch script to do the same:

@echo off

for /F “usebackq tokens=5″ %%f in (`netstat -b -n ^| find “:%1″`) do call :process %%f

goto :eof


tasklist /FI “PID eq %1″ /NH

If the above code was called findport.bat then running findport 8080 would then find the process owning port 8080.