Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2004-01-11 21:34:01
Size: 1504
Editor: anonymous
Comment:
Revision 4 as of 2011-04-27 05:05:25
Size: 3177
Editor: ?KarlOPinc
Comment: Use a flash drive
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
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.
Line 4: Line 3:
However, there is a way round it - and this is how I did it. == "apt-get dist-upgrade" in limited hard drive space ==
Line 6: Line 5:
Firstly, create a file which lists the packages that will be updates thus: Having a small hard drive can make ''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. The easiest solution is recommended in the [[http://www.debian.org/releases/squeeze/i386/release-notes/ch-upgrading.en.html#sufficient-space|release notes]]:
Line 8: Line 7:
apt-get -s -u upgrade || sed -n -e ''^Inst'',/^Conf/p -e /^Conf/q || cut -d" " -f2 >update.packages {{{
Use a temporary /var/cache/apt/archives: You can use a temporary cache directory from another filesystem (USB storage device, temporary hard disk, filesystem already in use, ...)
Line 10: Line 10:
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. Note: Do not use an NFS mount as the network connection could be interrupted during the upgrade.
Line 12: Line 12:
Next, you need to download those packages: For example, if you have a USB drive mounted on /media/usbkey:
Line 14: Line 14:
   1.

      remove the packages that have been previously downloaded for installation:

      # apt-get clean

   2.

      copy the directory /var/cache/apt/archives to the USB drive:

      # cp -ax /var/cache/apt/archives /media/usbkey/

   3.

      mount the temporary cache directory on the current one:

      # mount --bind /media/usbkey/archives /var/cache/apt/archives

   4.

      after the upgrade, restore the original /var/cache/apt/archives directory:

      # umount /media/usbkey/archives

   5.

      remove the remaining /media/usbkey/archives.

You can create the temporary cache directory on whatever filesystem is mounted on your system.}}}

The release notes mention other methods as well.

What follows is a report of how one Debian user managed the problem. It does not appear to be simple or reliable which goes to show that while you're free to do as you wish you will likely be better served by obtaining [[http://www.debian.org/support|support via offical Debian channels]].
------

However, there is a way round it. This is how I did it. First, create a file which lists the packages that will be updated 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 recognise to be heavyweights, 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:{{{
Line 15: Line 57:
}}}
This runs a loop which looks at the packages in update.packages and installs them.
Line 16: Line 60:
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).
Line 18: Line 65:
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.
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.

"apt-get dist-upgrade" in limited hard drive space

Having a small hard drive can make 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. The easiest solution is recommended in the release notes:

Use a temporary /var/cache/apt/archives: You can use a temporary cache directory from another filesystem (USB storage device, temporary hard disk, filesystem already in use, ...)

Note: Do not use an NFS mount as the network connection could be interrupted during the upgrade.

For example, if you have a USB drive mounted on /media/usbkey:

   1.

      remove the packages that have been previously downloaded for installation:

      # apt-get clean

   2.

      copy the directory /var/cache/apt/archives to the USB drive:

      # cp -ax /var/cache/apt/archives /media/usbkey/

   3.

      mount the temporary cache directory on the current one:

      # mount --bind /media/usbkey/archives /var/cache/apt/archives

   4.

      after the upgrade, restore the original /var/cache/apt/archives directory:

      # umount /media/usbkey/archives

   5.

      remove the remaining /media/usbkey/archives. 

You can create the temporary cache directory on whatever filesystem is mounted on your system.

The release notes mention other methods as well.

What follows is a report of how one Debian user managed the problem. It does not appear to be simple or reliable which goes to show that while you're free to do as you wish you will likely be better served by obtaining support via offical Debian channels.


However, there is a way round it. This is how I did it. First, create a file which lists the packages that will be updated 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 recognise to be heavyweights, 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 loop 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.

I'm interested to hear if anyone can script this, so that it becomes more automatic. Please leave any suggestions here.