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
2
  • where is your / ? Why is it on a /dev/loop ?
    – josinalvo
    Oct 13, 2012 at 14:53
  • Here, a simple reboot solved the issue. As @josinalvo explained, / was full and was increased on the fly: The disk was a virtual disk.
    – koppor
    Feb 24, 2014 at 19:46

7 Answers 7

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.

9
  • 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 9, 2014 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 5, 2015 at 5:03
  • 1
    To do 2 even simpler: after cleanup just reboot. This avoids problems with umount /tmp because of a being busy.
    – Roland
    May 1, 2016 at 11:03
  • 3
    Actually, I failed to umount this tmpfs by all above ways. I googled umount -l /tmp and it helped.
    – Leotsarev
    Dec 11, 2017 at 21:06
  • 1
    use size with G or MB with all above, and it will work.
    – Elshan
    Feb 19, 2020 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.

6

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.

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

2
  • is there a 'safer' tool, apparently gparted is kinda tricky to handle especially for noobs
    – seeker
    Oct 13, 2012 at 8:47
  • It is very tricky, and not the easiest way to address the problem. I would not venture using it for this
    – josinalvo
    Jul 13, 2021 at 19:21
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
-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
  • 1
    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, 2013 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .