Archive

Apt Get On Small Harddrive

Having a small hard drive can make apt-get dist-upgrades a complete nightmare, as apt-get likes to download everything and then dist-upgrade, filling up your harddrive before the download is complete.

However, there is a way round it – and this is how I did it.

Firstly, create a file which lists the packages that will be updates thus:

apt-get -s -u upgrade | sed -n -e Inst,/Conf/p -e /^Conf/q | cut -d” ” -f2 >update.packages

This will create a file called update.packages which has a list of packages to update. Before you do anything else, have a look at it and guage whether you think it is too long. Any packages that you recongnise to be heavy-weights, take them out for now. If you’re running really low end, you can even update it a package at a time.

Next, you need to download those packages:

for f in $(cat update.packages); do apt-get install “$f”; done

This runs a look which looks at the packages in update.packages and installs them.

Next, you need to clean things up to make room for the next cycle of install with:

apt-get clean

Then repeat the process until update.packages no longer has any text in it (which means there are no other packages to update).

Finally, you can carry out apt-get dist-upgrade, which on my machine managed to work. This could still fill up your machine in theory.

Thanks to Hugo for this.

Leave a Reply