Category Archives: Tech Notes

Techie notes

Kernel hording

Ubuntu logo ubuntu.comAfter my previous successful and speedy upgrade I thought I would continue to the 12.04 precise. However, I found myself running out of space of the /boot drive. That left me wondering why I made it this small but I think it is really a default setup. This is the message I saw when performing the do-release-upgrade:

Not enough free disk space

The upgrade has aborted. The upgrade needs a total of 24.7 M free
space on disk '/boot'. Please free at least an additional 13.9 M of
disk space on '/boot'. Empty your trash and remove temporary packages
of former installations using 'sudo apt-get clean'.

The recommended sudo apt-get clean didn’t really free anything, the next thing recommended was editing the size of the boot partition but I didn’t have the nerve to do that on a running system so I searched on…
Turns out I have been hording my old kernels. Then I found the following tool…. but…
Install yum-yutils:apt-get instal yum-utils
Run:package-cleanup --oldkernels --count=3 --keepdevel
And get:

Traceback (most recent call last):
  File "/usr/bin/package-cleanup", line 384, in 
    util = PackageCleanup()
  File "/usr/bin/package-cleanup", line 59, in __init__
    self.main()
  File "/usr/bin/package-cleanup", line 337, in main
    self._remove_old_kernels(opts.kernelcount, opts.keepdevel)
  File "/usr/bin/package-cleanup", line 273, in _remove_old_kernels
    (kver,krel) = runningkernel.split('-')
ValueError: too many values to unpack

Anyway, it is pretty easy to clean up the old kernel by hand.

rm /boot/*2.6.38-11-server
rm /boot/*2.6.38-12-server
rm /boot/*2.6.38-13-server
rm /boot/*2.6.38-14-server

Ubuntu release upgrade

Ubuntu logo ubuntu.comAfter my previous problem trying to update my Ubuntu server running 10.04 I tried to do a release upgrade.

Before I was able to do this I had to change the sources.list again, this time I used the mirror schema as recommended here.

Old:

deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ lucid main restricted

New:

deb mirror://mirrors.ubuntu.com/mirrors.txt lucid main restricted
deb-src mirror://mirrors.ubuntu.com/mirrors.txt lucid main restricted

The download of 430MB was pretty quick and took around 5 min to complete. Installation took a lot longer…

Ubuntu repository Singapore failures

Ubuntu logo ubuntu.comI just notice that when trying to update some of the Ubuntu server I have running that they can not find the archives. This is the error I get:

Err http://sg.archive.ubuntu.com lucid Release.gpg
Could not connect to sg.archive.ubuntu.com:80 (111.90.255.252). - connect (111: Connection refused)

I found some info about archives being hosted on the Amazon ec2 cloud so I decided to switch repository. To do this problem open the sources.list found under /etc/apt/sources.list

Original entries from sources.list

deb http://sg.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://sg.archive.ubuntu.com/ubuntu/ lucid main restricted

New entries in sources.list

deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ lucid main restricted

Now I am able to connect but I end up with the following error:

Fetched 1 B in 3s (0 B/s)
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_natty-security_main_source_Sources Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

Not much I can do about this. The same error occurs on different network locations and using different archives and different version of Ubuntu. Let’s hope they fix it soon.
You can check the mirrors that are available for your location here.