47

I'm not able to run update manager as I get an error saying that there is not enough free space in the /tmp directory. I've practically cleaned out the tmp directory but the error persists.

here's df-h

/dev/loop0       13G   11G  952M  92% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           785M  920K  784M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  584K  2.0G   1% /run/shm
/dev/sda6        20G   14G  6.4G  68% /host

overflow        1.0M   16K 1008K   2% /tmp
Zanna
  • 72,312
seeker
  • 1,757

7 Answers7

74

What seems to have happened:

Your / was full, then Ubuntu created a new partition, in RAM memory, to use temporarily.

Now, this 1MB partition is not big enough for the job, either.

What we can do:

1) increase the size of this partition just to do the upgrade

2) actually delete enough files in the HD that this partition is no longer needed.


To do 1:

open a terminal and run

sudo umount /tmp
sudo mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp

This should give you an 1MB partition (just like the one you had =P).

Now, to increase the size, you increase the size in that line, so that, with size=10485760, you'd get 10 MB.

Your goal is to find a number that is enough for the job, but leaves enough ram too

Comments on 1

You may want to try sudo umount -l /tmp, if you get some variation of "the file system is busy and cannot be unmounted"

Another possible solution to "the file system s busy(...)" is to do fuser -m /tmp to find pids (process numbers) that are using /tmp, then ps -elf <pids>, stop or kill processes

You may want to try sudo mount -t tmpfs -o size=1MB,mode=1777 overflow /tmp or even sudo mount -t tmpfs -o size=1G,mode=1777 overflow /tmp (for 1 megabyte or 1 gigabyte, respectively) - that is, units are available so that you dont have to type a huge number


To do 2:

Open a terminal and run sudo umount /tmp or, if that fails, sudo umount -l /tmp.

Then clean up!

Delete files in /tmp (now /tmp is the thing actually in your HD, rather than a virtual ram disk), uninstall unused packages, delete files in your home folder and so on.

josinalvo
  • 7,017
11
sudo mount -o remount,size=1048576 /tmp

changes tmpfs size without need to unmount partition and hence not disturbing running apps.

scorpp
  • 211
9

I know about this problem on my Kubuntu 16.04, and user63070 shows the best answer. Change the size at /etc/fstab like this:

tmpfs     /tmp     tmpfs     defaults,size=10G,mode=1777     0     0

Reboot, and you got 10GB for your /tmp folder.

Da Flex
  • 91
  • 1
  • 1
0

If you install your Ubuntu with default LVM settings nowadays, your LV size might be to low. Run:

df -h

and check if /dev/mapper/ubuntu--vg-ubuntu--lv is full (about 100%). If so, run:

sudo lvdisplay

to get the actual size of your LV. If you have space left more than that, you can allocate it by:

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

This will then use all available disk space. Extend the filesystem afterwards to use the new disk space:

sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
0

Looks like your / partition is full.

If you have space on other partitions on your disk, you might use this space to increase the size of your / partition. There are tools available for this, for example gparted.

sudo apt-get install gparted

http://gparted.sourceforge.net

josinalvo
  • 7,017
0

I am pretty sure @user220420 was referring to /etc/fstab instead of /etc/mtab. I had lots of free GB in my root, however, Firefox wouldn't let me download anything from the internet. A small window would pop-up before finishing any download, telling /tmp had not enough space left. Within fstab, there's this line where you can increase tmp's folder size. It was set to 100M so I changed it to 1000M. After reboot, I right-clicked on /tmp (in root) and properties showed 1GB free (to make sure changes applied properly). That was it.

-1

Open up /etc/mtab in your favorite text editor with root privledges (ie “sudo vim /etc/mtab”). And increase the memory allocated to your /tmp folder. After restart Ubuntu will increase the space to /tmp, and fix this problem.