This page is specific to Ubuntu versions 10.04, 12.04 |
Updating the Ubuntu LTSP client chroot
Video tutorial available at http://www.youtube.com/watch?v=bARxhOn3mKo
By default, the 'ltsp-build-client' command in Ubuntu will pull packages from 2 repositories, as well as generate a chroot sources.list file within the newly created chroot with the same 2 repositories. An example how this looks like in Ubuntu 8.04 Hardy Heron is shown below:
deb http://archive.ubuntu.com/ubuntu hardy main restricted deb http://security.ubuntu.com//ubuntu hardy main restricted
Over time, packages that make up the LTSP chroot are updated with (sometimes major) bugfixes. By Ubuntu's packaging standards, a SRU is performed for packages that are deemed stable enough for people who utilize the "Recommended Updates" repositories (Check out System -> Administration -> Synaptic Package Manager, under Settings -> Repositories -> Updates). A default LTSP chroot will not inherit them, however, without extra ltsp-build-client options (such as —copy-sourceslist on a server with the hardy-updates repository (or the one for your current Ubuntu version) already enabled in its own sources.list). Chrooting to /opt/ltsp/i386 and performing an 'apt-get update && dist-upgrade' won't upgrade to new packages in hardy/intrepid/$YOURVERSION-updates, since the sources.list file doesn't contain the -updates repository. Even building a new chroot from scratch using ltsp-build-client won't help as it doesn't, by default, pull packages from $YOURVERSION-updates.
Note for upgrading across releases: If you have upgraded the LTSP server to a new release (such as Hardy -> Intrepid), it is recommended to build a new client chroot from scratch (you must also re-install any packages you had installed previously.), as the ltsp-build-client script does things a normal apt-get upgrade will not. Ensure all clients are logged out/shut down or you might experience very strange things. You can backup your current chroot and build a fresh one after the server release is upgraded by following commands: To upgrade your live chroot, we need to modify our existing /opt/ltsp/arch/etc/apt/sources.list file to include our Follow any directions/instructions while upgrading packages. Make sure you tend to any errors while upgrading, as packages that fail to install correctly could potentially cause thin-clients to not boot correctly. Also, if you get any errors that look similar to: Can not write log, openpty() failed (/dev/pts not mounted?), disregard them as they are purely cosmetic. See LP Bug 330194 for updates on this. sudo mv /opt/ltsp /opt/ltsp-orig
sudo ltsp-build-client
sudo cp /etc/apt/sources.list /opt/ltsp/i386/etc/apt/sources.list
export LTSP_HANDLE_DAEMONS=false
sudo chroot /opt/ltsp/i386
mount -t proc proc /proc
apt-get update && apt-get dist-upgrade
exit
sudo ltsp-update-kernels
sudo umount /opt/ltsp/i386/proc
sudo ltsp-update-image
Notes: Ubuntu bug #277331 reported for including *-updates when using 'ltsp-build-client'
Upgrade shell script
This may prove useful once everything is in place and you need to regularly upgrade the chroot directory. Adjust accordingly but it assumes the defaults.
#!/bin/sh CHROOT_DIR=/opt/ltsp/i386 sudo chroot $CHROOT_DIR mount -t proc /proc /proc sudo chroot $CHROOT_DIR apt-get update sudo chroot $CHROOT_DIR env LTSP_HANDLE_DAEMONS=false apt-get dist-upgrade sudo umount /opt/ltsp/i386/proc sudo ltsp-update-kernels -b /opt/ltsp -d ltsp sudo ltsp-update-image -p 2000 -b /opt/ltsp -a i386
The above script can be modified with the purpose of installing packages. Below we have done so for the installation of packages listed as positional parameters:
#!/bin/sh
CHROOT_DIR=/opt/ltsp/i386
sudo chroot $CHROOT_DIR mount -t proc /proc /proc
sudo chroot $CHROOT_DIR apt-get update
while [ "$1" != "" ]; do
sudo chroot $CHROOT_DIR env LTSP_HANDLE_DAEMONS=false apt-get -y install $1
shift
done
sudo umount /opt/ltsp/i386/proc
sudo ltsp-update-image -p 2000 -b /opt/ltsp -a i386