How can I increase Ubuntu swap space?

If you don't want to/can't create a new or larger swap partition, you can use a swap file.

  1. Create a file of the size you need: "dd if=/dev/zero of=/root/tmpfile bs=1m count=1024" would create a 1 gigabyte file.
  2. Define the file as swap: "mkswap /root/tmpfile".
  3. Activate with "swapon /root/tmpfile".

I'm assuming you need the new swap only temporarily. If you want to make it permanent, you'll need to add an entry to /etc/fstab:

/root/tmpfile none swap sw 0 0


Boot from the Ubuntu install CD, use the partition editor included, then resize the swap partition. If there's no free unallocated space available, you can resize other partition to make space.