How to upgrade Ubuntu

upgrading ubuntu

I hit the Upgrade button and I presume it’s doing it’s thing. The Ubuntu 8.04 ‘Hardy Heron’ Release Notes have just popped up so it’s time to click the “Upgrade” button again. Tom has some great tips for post install configuration.

I’ll be happy if SDLMame, mplayer, UAE and Vice continue to work as normal after the upgrade. Finger’s crossed. It’s getting easier and easier to upgrade Linux distros these days!

Update! Ubuntu Hardy is now installed and it appears to be working fine. There was a problem with SDLMame unfortunately. This dialog appeared at the end of the upgrade:

ubuntu upgrade problem

I didn’t think that would be a problem to fix but then the same dialog appeared saying the “update-manager” had failed to upgrade! Oh no! Anyway, I clicked Close, thinking it was related to the SDLMame problem and then this shocker appeared:

could not upgrade!

Ah crap! It took over a day of downloading packages to get this far. Sheesh. I closed that dialog and then, nothing. The update manager closed too and I was left looking at a blank desktop. Thinking I had nothing to lose, I rebooted and to my joy up popped Ubuntu Hardy!

I reinstalled SDLMame which fixed the problems with that. Everything else works ok and I’m just wondering if I’m missing anything because the upgrade aborted? Who knows. It works. I’m happy.

HOWTO: Ubuntu desktop visual effects on Dell D630

The Dell Latitude D630 comes with a number of different video cards but if you use the Intel chipset you may be frustrated when trying to activate the visual effects eye candy of Compiz:

Ubuntu Visual Effects

Checking either of the lower two options brings up this alert saying, “Desktop effects could not be enabled”.

Ubuntu Visual Effects

I didn’t bother trying to fix it for ages and put it down to using Ubuntu on exotic hardware. Fortunately it’s simple to get working. I just needed to install the xGL server:

# aptitude install xserver-xgl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be automatically installed:
  libglitz-glx1 libglitz1
The following NEW packages will be installed:
  libglitz-glx1 libglitz1 xserver-xgl
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/1843kB of archives. After unpacking 4854kB will be used.
Do you want to continue? [Y/n/?]

Once I logged out (and rebooted, for some reason my external monitor doesn’t always “catch” when I restart X) and back in again xGL was loaded and I was able to enable desktop visual effects. Despite my misgivings about using an embedded graphics chip it actually works really well. Windows bounced around, bent out of shape and did lots of nice animation stuff.

Then I removed the whole lot by uninstalling the xserver-xgl package again. Why? Unfortunately it conflicts with other openGL apps. In a toss up between fancy desktop effects and decent SDLMame performance, SDLMame wins hands down. It’s nice to know the visual effects work though!

How to umount when the device is busy

It happens all the time doesn’t it? You need to unmount a CD or you want to pack away the external drive but when you try to umount it you get the dreaded “device is busy” message. Wouldn’t it be great if Linux actually told you what was keeping the drive busy? Here we are in 2008, I’m using Ubuntu Gutsy, and that message hasn’t changed in all the years I’ve used Linux.

# umount /media/disk/
umount: /media/disk: device is busy
umount: /media/disk: device is busy

First thing you’ll do will probably be to close down all your terminals and xterms but here’s a better way. You can use the fuser command to find out which process was keeping the device busy:

# fuser -m /dev/sdc1
/dev/sdc1: 538
# ps auxw|grep 538
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox

Rhythmbox is the culprit! Close that down and umount the drive. Problem solved!

Ubuntu WiFi problems on the Dell D630 laptop

Wireless networking was always a bit patchy for me on my Dell Latitude D630 while running Ubuntu Gutsy version of Linux. It would work fine for ages and then freeze up suddenly, requiring a hard reboot to get things working (Apache would become unkillable, I guess because it was attached to the broken Wireless networking driver.) Problems always showed up when I transferred large amounts of data between Linux and my Macbook. Files copied fine for a few minutes and then the whole house of cards would collapse. Crash! Boom!

The first time I looked for a solution nothing turned up, but eventually I went searching again, and after digging into all sorts of forums and websites I found the simpe solution on the Dell Linux Wiki:

Create a file called /etc/modprobe.d/blacklist-ipw3945 and add:

blacklist ipw3945

Add to /etc/modules:

iwl3945

Reboot after doing that and all will be fine in the world again! I haven’t had any networking issues since replacing the ipw3945 driver with the iwl3945 one!

Ubuntu Gutsy on the Dell Latitude D630

I previously documented my problems with Ubuntu and the DVD in the D630 but the upgrade to Ubuntu 7.10 Gutsy From Feisty went almost painlessly.

ubuntu 710 upgrade

All the packages downloaded and installed through the nice GUI front end. I was able to work away while they downloaded and for most of the time during install too, but when I rebooted I found that sound wasn’t working! I found this solution but I didn’t want to compile a kernel again. That’s so 90’s and this is 2007! Instead I checked my grub menu.lst and found there was an older 2.6.20 kernel listed there. A quick reboot later and sound works again, and it’s even louder! WiFi never stopped working thankfully but if you’re having problems, the page above explains what you need to install to get it working.

I haven’t tried the eye candy features yet, but so far the system feels springier and lighter, even with the old kernel. Let’s hope it stays that way!

Bah. GIMP 2.4rc3 broke a lot of the Script-fu scripts I use. I read about this somewhere. Time to get my hands dirty in my lomo plugin for starters.

Nice! Gthumb supports RAW images although it takes ages to initially process them initially.

Ubuntu Linux on Dell D630: the DVD

Getting the DVD drive working in Ubuntu Feisty on my Dell D630 laptop was one of the tasks that eluded me until a few minutes ago when I went searching again and found the solution.

At first I tried this and used the ide-generic driver. Linux recognised the drive, but as the page above says, it doesn’t give you any DMA modes. I tried the Bourne Supremacy, just to see if anything would happen, but Totem just sat there and the system became sluggish while the CD made some whirring noises. That’s a sure sign that DMA isn’t working!

That wasn’t going to be satisfactory, so I kept searching. This page and some of the Ubuntu forums suggest loading the “piix” and “ata_piix” modules. I tried to modprobe them without luck, but when I added “piix” to my /etc/modules and rebooted my DVD drive was found!

DMA is now enabled and everything works ok. Even got the film to play in Mplayer and it was very smooth.

# hdparm -i /dev/hda

/dev/hda:

Model=TSSTcorp DVD+/-RW TS-L632D, FwRev=DE04, SerialNo=
Config={ Fixed Removeable DTR10Mbs nonMagnetic }
RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=0kB, MaxMultSect=0
(maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
IORDY=on/off, tPIO={min:227,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2
AdvancedPM=no

# hdparm /dev/hda

/dev/hda:
IO_support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 1 (on)
readonly = 0 (off)
readahead = 256 (on)

How labels saved my life

Well, they made it easier. Saved might be a little strong. When using a Unix based system you use a file called /etc/fstab to designate all the hard drives and external storage like flash cards and where they will mount or live on your filesystem. It’s not quite like the Windows world where everything has a drive letter, although you can use SUBST to get a similar effect on that operating system.

/etc/fstab is easy to maintain when all your drives stay in one place, but since I’m using 3 external drives and a card reader, sometimes the device name /dev/sdX changes for each. It’s horribly frustrating changing entries in fstab just because the card reader wasn’t plugged in when the computer booted into Ubuntu Linux

That all changed when I assigned labels to each drive. Now fstab entries reference those labels instead of devices! The following line,

/dev/sdc1 /media/disk auto rw,user,noauto 0 0

becomes

LABEL=DATA /media/disk auto rw,user,noauto 0 0

So, even if the device changes from sdc1 to sdd1 /media/disk will always mount!

Here’s a great tutorial on how to assign labels to disks, and how to modify your /etc/fstab to support them. It might seem like a pain at first but it’s well worth it!

Open a new window here in Ubuntu Linux

cmdline.png

One of the things I missed a long time ago in Windows completely was the handy “start” command I could type from a command prompt to open a new Windows Explorer window in whatever directory I was in. Can you still do that? Does anyone use Windows from the command prompt any more?

nautilus.png

I have since discovered you can do the same thing in Ubuntu Linux (and any other Linux for that matter of course!). I’m a big fan of Gnome, which uses the Nautilus file manager. If you’re fond of navigating your computer using a terminal, it’s really easy to open a Nautilus window in the current directory. Simply run ‘nautilus .‘ and a new window will open in that directory.

Don’t tell me you’re a keyboard junkie, I am too. I use Vim! Nautilus is still very useful though. Besides it’s obvious use as a file manager It’s dead handy for copying files to a remote server using any number of transmission protocols from ssh and SMB through to plain old ftp. But more on that some other time eh?

The real way to improve server performance

If you want to improve server performance, the best way is to move as much of the processing off it and onto the client machine. All those visitors of yours are running souped up AMD and Intel CPUs with their big screens and fat harddrives. No wonder your small little hosting plan can’t keep up. Here are some very good ideas from a Slashdot comment I read this morning.

  • Databases can get pretty slow with complicated queries, so upload your database to the client when they load the page and then your database queries are distributed.
  • PHP isn’t very fast, and neither are Perl or Python, so you don’t want to be running them on the server either. Write an interpreter for the language of your choice in Javascript and move your business logic to the client. This will also interface better with the client side database copy.
  • SSL is a performance killer, don’t use it. If you need to send something securely just prefix it with a predetermined number of random letters and numbers, no one will think to look beyond them.
  • Writing to databases can be pretty bad too. Try discarding all your changes, your users might not notice the difference, but they will appreciate the performance gain.

Check out the original post for a few more invaluable nuggets. If you follow all these tips you’ll be well on your way to becoming a respected and l33t hacker.

And now the big news. I’m really excited about this. The next version of WordPressMU will have a special Javascript client-side db (JCSDB) library built in. JCSDB will enable distributed and parallel access to your WPMU db without the danger of harming your servers. The best thing about it? If your site is dugg or slashdotted then your visitor’s machines will handle the load transparently. Instead of using slow and ungainly TCP/IP the library will use super-quick UDP to communicate. It really is the best way of sending data over the Internet.

I expect Matt will roll out JCSDB on WordPress.com just as soon as a few of the final bugs are ironed out. It might be a bit of headache for Barry and Demitrious to administer, but at least we can get rid of at least half our servers and use them to power a massive game of Counter Strike at the next WordCamp.

Update on May 31st! You all thought this was a joke didn’t you? Well, Google Gears has just been released and “is an open source browser extension that enables web applications to provide offline functionality”.

  • Store and serve application resources locally.
  • Store data locally in a fully-searchable relational database
  • Run asynchronous Javascript to improve application responsiveness.

It’s still in beta but Google Reader already supports it by allowing you to download up to 2000 items to read offline. This could be useful when I’m flying to SF next July!