45

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
  • 70,465
seeker
  • 1,707

7 Answers7

73

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
  • 6,947
  • 5
  • 37
  • 51
  • 5
    This answer worked for me but I needed to kill some things before /tmp would umount. If you get a message that says /tmp is busy, then do fuser -m /tmp to find pids that are using /tmp, then ps -elf <pids>, stop or kill processes. Then umount /tmp. Also suggested on internet sudo umount overflow. – gaoithe May 09 '14 at 15:10
  • 2
    @gaoithe I used sudo lsof | grep tmp to find the pid then kill to kill it. In my case this was Xorg. This is the X Window System which I don't use anyways. – DutGRIFF May 05 '15 at 05:03
  • 1
    To do 2 even simpler: after cleanup just reboot. This avoids problems with umount /tmp because of a being busy. – Roland May 01 '16 at 11:03
  • May i know why you have reverted back my edits? – heemayl Jul 16 '16 at 13:49
  • Thank you for your improvements on my answer! (but some, I did not like and removed) – josinalvo Jul 16 '16 at 13:53
  • Too many processes to fool around with on a live web server, so I followed @Roland's suggestion to reboot (sudo shutdown -r now). As a side benefit I gained back 10G on a 40G file system - although that may have been from rebuilding db tables (mysql "optimize") I did just to be sure. – kitchin Mar 01 '17 at 14:34
  • 3
    Actually, I failed to umount this tmpfs by all above ways. I googled umount -l /tmp and it helped. – Leotsarev Dec 11 '17 at 21:06
  • The instruction under 'to do 2' worked for me. With Ubuntu 14.04 LTS. This issue came about after updating a kernel images. I have removed unused kernel images following https://superuser.com/a/1042344/491642 – XavierStuvw May 26 '19 at 08:41
  • 1
    use size with G or MB with all above, and it will work. – Elshan Feb 19 '20 at 21:01
8
sudo mount -o remount,size=1048576 /tmp

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

scorpp
  • 181
7

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
  • 71
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
  • 6,947
  • 5
  • 37
  • 51
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.

  • Let me tell you that this worked with other distros other than Ubuntu. I could accomplish this on Sabayon as well. – vienswuer Sep 26 '14 at 18:34
-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.

  • 1
  • You don't edit /etc/mtab - that file is handled by mount, 2) there is probably no entry fo /tmp in etc/fstab either.
  • – guntbert Nov 29 '13 at 20:42