Op deze pagina vindt u een aantal problemen waarvoor Suares & Co oplossingen zocht.
Technology
On this page some solutions we found for some uncommon issues.
ltsp-build-client and apt-mirror
14-03-2008
Using apt-mirror to build a local repository
Install apt-mirror:
sudo apt-get install apt-mirror
Configure apt-mirror to include the repositories of your choice. Open /etc/apt/mirror.list in your favorite editor and add repositories:
# base repositories
deb http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu dapper-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
This is for dapper and gutsy, but of course you might only want gutsy, or hardy... or you could add other repos, for instance:
# commercial
deb http://archive.canonical.com/ubuntu dapper-commercial main
# amd64
deb-amd64 http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-amd64 http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
# you get the point ...
You probably need quite a lot of space, so maybe you want to change the base_path to point to another place in your filesystem.
Of course, change $APT-MIRROR-VAR-DIRECTORY into something sensible. In my case it's /apt-mirror/var. I mounted a whole 160GB disk under /apt-mirror, which has many advantages.
To access the repositories, you might want a webserver running. You could use lighttpd or apache for that. Configuring the webserver is not within the scope of this document. Suffice to know that my repos are accessible to my LAN by a URL like this:
http://my-repo-server/archive.ubuntu.com/ubuntu
So, if in the mirror-list you have a line like this:
deb http://archive.ubuntu.com/ubuntu gutsy-updates main
You should, on a machine on your LAN that you want to use that repo, have a line in /etc/apt/sources.list that looks like:
deb http://my-repo-server/archive.ubuntu.com/ubuntu gutsy-updates main
Of course, if 'my-repo-server' is not a Fully Qualified Domain Name that can be resolved trough DNS, you need to edit your /etc/hosts file (on the machine you want to update).
Note: the 'clean' mechanism of apt-mirror hasn't worked very well for me, so I am not using it very often, which means that the number of old and useless packages increases, taking up lots of disk space. But I have experienced that the clean script deletes too many packages, sometimes up to 9 GiB of packages, that then have to be downloaded again. Over a 256k line, that's quite a drag. I still do it sometimes, cause sometimes cleaning 30 G of files is worth the download. I should file a bug or something.
Note: to stay up-to-date, a cron job is run nightly. It downloads all the new packages.
#
# Regular cron jobs for the apt-mirror package, 4:05 each night.
#
5 4 * * * apt-mirror /usr/bin/apt-mirror > /apt-mirror/var/cron.log
Note that '/apt-mirror' is the base_path, it might differ in your case.
Running ltsp-build-client to install ltsp on Ubuntu Gutsy
Note: if 'my-repo-server' can be resolved trough DNS, then you better use the name, else you need to use the IP-number. The reason for that is that after ltsp-build-client does a chroot, your /etc/hosts file (actually /opt/ltsp/i386/etc/hosts) won't know about the changes in your regular /etc/hosts file.
Also note that the mirror has /ubuntu tacked to the URL, and the security-mirror has not. (Don't know why but this is how it worked for me).
Normally, running ltsp-build-client should finish very quickly, a couple of minutes, as opposed to many hours if you have a slow connection to the Internet.
If your server is 64bit and your clients are 32bit (a very common configuration) then make sure you add '--arch i386' to the ltsp-build-client options.