Thursday, November 11, 2010

Getting Ubuntu installed on a laptop

I had managed to score for free from work an old laptop that was past its use-by date, for business use at least. It's an LG S1 Express Dual, with a Core Duo (not Core 2) processor. Previously, to extend its life a little longer I had installed 2GB of memory in it and a faster hard drive - that made a remarkable difference.

Being from around 2006, it had come with Windows XP pre-installed. I wanted to try a newer operating system than that, so initially I put Windows 7 on it. Now for people saying Linux is hard to get driver support for, Windows 7 was an ordeal in itself. First of all, LG have basically stopped making laptops. Drivers for it were not available on their site for windows 7. Some Vista drivers were available, so I had some of those installed. The graphics chip in this machine is an ATI Mobility Radeon X1400. Going to ATI/AMD's site to find a current driver just sends you to a page saying that it's the laptop maker's responsibility - they don't support it any longer.

Even things like network drivers were unable to be found easily. I remember having to scrounge around looking for whatever I could find, on obscure and slightly dodgy driver sites. In the end, Most of it worked. The on-screen display didn't work, some of the special functions didn't work, and got no joy from the included remote control.

One other setback was the BIOS not recognising hard drives over 137GB/128GiB in size. A bit of a setback, since I'd like to make use of all of the 160GB drive that was installed in it. First up, I tried dual booting with Linux, using the space at the end of the drive that BIOS and Windows couldn't see, but was no problem for Linux. Ubuntu booted fine, but Windows would refuse to boot, until I shrank the partitions down to fit under the 137GB limit.

Finally, I decided to just run a complete install of Ubuntu. Taking advantage of the release of version 10.10, I put in the 32-bit install disc (the Core Duo T2400 does not support 64-bit OSes) and nearly everything seemed to work pretty well. Especially networking, which did not work under Win 7.

A bit of tweaking was needed though. Sound wouldn't work. A little digging through the forums revealed the module for the sound card wasn't installed, and the following had to be added to the end of the file /etc/modprobe.d/alsa-base.conf:

options snd-hda-intel model=lg

This loaded the correct module at boot time, and sound now works.

One other problem I had was with the suspend functionality. While the system would go into suspend mode correctly, upon resuming the wired networking would refuse to work. I haven't tested wireless, as I do not have a wireless router yet. A little research revealed it was due to this bug, and that by manually unloading and reloading the network module, it would come back to life again. The commands to do that are:

sudo modprobe -r et131x
sudo modprobe et131x


Thanks to the user P4Man at ubuntuforums.org, a short script has been created, as detailed in this post:

Create a script named /etc/pm/sleep.d/11ethernet, with the following contents:

#!/bin/bash
case $1 in
suspend)
rmmod et131x
;;
resume)
modprobe et131x
;;
esac


Changing the “et131x” value to whatever the network module is. That is what the module is on this LG laptop.
Save file and make it executable:

sudo chmod 755 /etc/pm/sleep.d/11ethernet

Now, when the laptop goes into suspend mode, the network module gets unloaded, and upon waking up, the module gets reloaded. Networking works!

Boot up time is nice and quick with 10.10 as well - quicker than windows 7 which itself was no slouch. A far cry from its original state, with a slow old hard drive, Windows XP and a bajillion little programs that started on boot. All in all, it's a nice machine. Now I just have to buy a battery for it that works...

Tuesday, October 26, 2010

Latest Ubuntu conkyForecast update fix

(Updated 27 October, added recommended ln command, see below)
Today's update to conkyForecast, the program that enables the current weather conditions and a four-day forecast to be displayed on the screen, came with an unexpected downside. It stopped working. A bit of searching around for others with similar problems prompted me to look at the .xsession-errors file, in my home directory. From there, the message:

/usr/bin/conkyForecast: 3: /usr/bin/python2: not found

kept repeating. Having a look for the file /usr/bin/python2 showed that yes, that file was indeed non-existent. This was puzzling. I opened up the file /usr/bin/conkyForecast, to see where it was mentioned. It is only a short file of a couple of lines, but one of them did call python2. This is a link in the /usr/bin directory, pointing to python2.6.

There are two fixes to this. One, I edited the file /usr/bin/conkyForecast and changed python2 to python. This fixed it - the forecast was displaying on screen again, but further updates to the script would overwrite this, meaning you'd have to do it again. Therefore, I'd recommend the following method.

The other, recommended, way to fix it is to re-create the python2 link in /usr/bin: I just restored it from a backup made a few days ago (Yay for backintime!), but you could just create a link to python2.6 with the ln command, as below:

sudo ln -s /usr/bin/python2.6 /usr/bin/python2

As an update, a little further searching revealed this post on the Ubuntu forums. This is a known issue with Ubuntu 10.10, where there is no link to python2. ConkyForecast was updated to point to python2, in preparation for later versions of Python.

Saturday, October 16, 2010

Upgrade to Maverick Meerkat - version 10.10 worked!

I am writing this from my newly-upgraded Ubuntu 10.10 system! This has been the second time I upgraded the installation, rather than start afresh. I was a little nervous, to be honest, but backups were made before the upgrade so there was an escape plan.

There were only a few issues that were pretty easily fixed, and I may, just may, have fixed the hanging on boot problem I had with version 10.04.

One problem I had was the Hard drive temperature reporting in Conky - it stopped displaying a temperature. This was because the hddtemp command could only be run as root - Conky doesn't run with those privileges, and I didn't want to start doing so. A quick search revealed a single line command to allow hddtemp to be run as a regular user:

sudo chmod u+s /usr/sbin/hddtemp

After doing that, the disk temperature re-appeared and all was good.

Fixing the boot screen

This was a problem that I had in the previous version, 10.04, as well as in 10.10. It is to do with running the Nvidia proprietary drivers, and switching to different video modes. Basically, there are some steps to try at this site, which I did. It involves setting some video modes in the boot loader. I initially tried 1680x1050 (about the best that was supported by my card, even though it runs at 1920x1080 once at the desktop) and got a comically large ubuntu logo during boot. A later change to 1280x1024 yielded a much better result.

So far, the boot and shutdown screens look much better, and I haven't yet had it hang on me. I am hesitant to call it truly fixed until a few more weeks have passed.

Edit January 7, 2011: If you do these changes and then switch back to the open source driver (nouveau), you have to undo the changes to be able to set the proper resolution for your screen(s).

Monday, October 11, 2010

Adding the new Ubuntu fonts to your existing installation

With the release of version 10.10 comes a new set of fonts, named Ubuntu. If you're not ready to upgrade to the new version just yet, you can install just the new fonts by downloading them here.

Just double-click the downloaded file to run the installer. You'll have to change the fonts used under System -> Preferences -> Appearance -> Font; change The Application, Document and Desktop fonts to "Ubuntu", the Window title font to "Ubuntu Bold".

If you're using Google Chrome, you can install this extension to use the new fonts. You will probably have to change the default fonts under the preferences menu.

Friday, October 8, 2010

My list of tweaks - what I change and add after a fresh install

With the release of version 10.10 in a few days, this post partly serves as a reminder to myself what I have installed on my machine, and how it is set up. It will probably also make pause and reconsider doing a clean installation, when I look at the amount of configuration I would have ahead of me!

Programs not in Ubuntu repositories:

Crashplan - for backing up user data such as documents, music, photos. Not so much for system data - I use backintime for that.

Dropbox - for syncing some of my data between computers - e.g. between home and work PC.

A whole bunch of Google programs - Google Earth, Chrome, Picasa and Desktop. They probably now know more about me than I do...

conkyforecast - a part of Conky that supplies weather forecast info on the desktop, along with a bunch of other system stats that allow me to keep tabs on what's happening on the PC. One of the programs I consider essential. Working without it is like driving a car with no dashboard.

Photography/Image editing:

Flickr Uploader - I initially downloaded this because I stopped using F-Spot, as it was too damn buggy. When I was trying other programs, none of them had a way to upload photos to my flickr account. This utility is pretty handy, letting you tag photos individually or as a group.

DigiKam - I thought for a while before installing this, as it is a KDE program. Choosing to install this requires also installing a bunch of the KDE framework. If you are interested in keepiing a lean system, maybe this isn't for you. However, I was looking at some sort of photo management and editing software. Bibble and Adobe Lightroom are the main contenders. Bibble is a paid app, as is Lightroom, which has the downside of being Mac and Windows only. I thought, what the hell, digiKam is free, so I'll try this one first. So far, it has worked pretty well. It isn't quite as polished as the other two, but my wallet says it is just fine.

Music:

Rubyripper - an open-source equivalent of Exact Audio Copy for windows.

Other:

Bleachbit - does a similar job to what CCleaner does in Windows.

Virtualbox - for running virtual machines, testing other operating system installs. Good to tinker and learn things.

Deluge Bittorrent client. I prefer it to Transmission (which is installed by default).

HDParm: a later version, which includes a copy of the wiper script that performs garbage collection on solid state hard drives, marking sectors as deleted. The new version of Ubuntu should have this included by default (as well as the 2.6.35 kernel, that supports the TRIM command).

Tweaks:

Since I have a solid state hard drive in my system (and I highly recommend them for anyone looking to upgrade their PC) there are a few SSD-specific tweaks you can do to get the best out of them. This site has an excellent guide. I didn't do all of them, just enabled the noop disk scheduler and mounted filesystems with the noatime flag.

There are a number of things to be done with regards to MythTV, one of which is setting up LIRC for the remote control to work. One thing I noticed with a bit of early tinkering with a later kernel was that the remote ceased to work with that kernel - that's a concern I have with moving to the new version.

Enabling the medibuntu repositories to allow MP3 playback, DVDs and a few other restricted formats. Version 10.10 apparently has an option to enable all of these at install time, which is welcome.

That's just a few things I've changed, no doubt I'll think of many more, especially if I do a reinstall from scratch. I'll let you know how I go: if I do an upgrade (quick, convenient, chance of hosing the system), fresh install (time consuming with all the re-configuring and reinstalling, but will be a nice fresh system), or staying with 10.04 (quickest of all, but missing out on new toys). I might hold out for a little while, but I'm sure I'll succumb to the allure of new and shiny...

Tuesday, September 28, 2010

Don't forget to update Grub on new kernel updates

Today there was a new kernel update - to version 2.6.32-25. I ran the update manager and the updates installed fine, and let it reboot. Upon restarting, I went to a terminal and checked what kernel was running: the previous one still. For some reason, after performing a kernel update, my system does not update the Grub menu to load the new version. Whether this is by design or it's just a quirk of my installation, I don't know. But let this just be a heads-up for other users. The security fixes in the new kernel won't be of any use if you are still running the old one!

Fortunately, it is easily fixed by entering "sudo update-grub" at a command prompt. It will look through your system and add the new kernel to the startup menu. After a while, when the new kernel appears to be working OK, you can uninstall the previous version to save some space.

Monday, September 27, 2010

Fix for Gnome Window List not updating

Over the last couple of months, I had been running the bottom Gnome taskbar panel with the "Expand" option not enabled. This meant that when no windows were open, the taskbar reduced in size, centred along bottom edge of the screen. As more programs are opened, it would expand to fit, eventually stretching across the screen. I did this to give a little more screen real estate to the Conky system monitor display down the right hand edge of the screen.

I ran it like that for a while, but started noticing the window list was acting a bit strangely. When I switched tabs in a web browser, the window title down at the bottom of the screen would not update: it was stuck on a previous page. At first I thought it was a Google Chrome issue, but the same thing happened in Firefox. I started working things out - it would update if I opened or closed another program. The extra window title being added to or removed from the taskbar would update all the others as it expanded or shrank. But this was a workaround - something was wrong.

With the new release of Ubuntu mere weeks away now, I didn't look too hard into fixes. Hopefully the new version would rectify it. Today, though, a thought just struck me - what if I turned on the "Expand" option again? I did it, and it all seems to be working fine. I can switch from tab to tab in the web browsers and the window list updates instantly.

So really, it isn't a fix, more a bug in Gnome's window list application. If you haven't purposely gone into the options to disable expand, you won't be affected - it's enabled by default in Ubuntu. Hopefully it will save some head scratching in the future.

Now my only ongoing Ubuntu issue is the occasional hang at boot or shutdown, on the Ubuntu splash screen. Still no fix for that that I have found, but I'll let you all know if I find something.