Error writing to output file, no space left

Asked by Chenyang Xu on 2017-05-12

I try to install "pip" command on the Ubuntu tablet, so I input "sudo apt install python-dev python-pip",but when I Get one, then output:

"Error writing to output file - write (28: no space left on device)"

However, my tablet have 9G free space, I wish someone could help solve this.


Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Chenyang Xu
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

For diagnostic purposes please provide the output of the commands

uname -a
lsb_release -crid
df -h
df -i

Chenyang Xu (1063830851-b) said : #2

The output:

uname -a:

     Linux ubuntu-phablet 3.10.93+ #1 SMP PREEMPT Tue Aug 9 19:16:20 UTC 2016 aarch64 aarch64 aarch64 GNU/Linux

lsb_release -crid:

Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid

df -h:

Filesystem Size Used Avail Use% Mounted on
udev 987M 4.0K 987M 1% /dev
tmpfs 198M 564K 198M 1% /run
/dev/disk/by-partlabel/userdata 9.5G 1.1G 8.4G 12% /userdata
/dev/disk/by-partlabel/system 3.8G 3.8G 4.0K 100% /
/dev/loop0 235M 224M 6.8M 98% /android/system
none 4.0K 0 4.0K 0% /android
tmpfs 990M 4.0K 990M 1% /etc/fstab
/dev/disk/by-partlabel/cache 992M 1.6M 975M 1% /android/cache
/dev/disk/by-partlabel/protect1 5.9M 44K 5.6M 1% /android/protect_f
/dev/disk/by-partlabel/protect2 5.9M 44K 5.6M 1% /android/protect_s
none 4.0K 0 4.0K 0% /sys/fs/cgroup
tmpfs 990M 172K 990M 1% /tmp
cgmfs 100K 0 100K 0% /run/cgmanager/fs
none 5.0M 0 5.0M 0% /run/lock
none 990M 6.9M 983M 1% /run/shm
none 100M 0 100M 0% /run/user
tmpfs 990M 0 990M 0% /media
tmpfs 990M 4.0K 990M 1% /var/lib/sudo
tmpfs 198M 52K 198M 1% /run/user/32011

df -i:

Filesystem Inodes IUsed IFree IUse% Mounted on
udev 252643 754 251889 1% /dev
tmpfs 253229 705 252524 1% /run
/dev/disk/by-partlabel/userdata 579040 20849 558191 4% /userdata
/dev/disk/by-partlabel/system 256000 148702 107298 59% /
/dev/loop0 15552 1497 14055 10% /android/system
none 253229 6 253223 1% /android
tmpfs 253229 2 253227 1% /etc/fstab
/dev/disk/by-partlabel/cache 65536 19 65517 1% /android/cache
/dev/disk/by-partlabel/protect1 640 11 629 2% /android/protect_f
/dev/disk/by-partlabel/protect2 640 11 629 2% /android/protect_s
none 253229 3 253226 1% /sys/fs/cgroup
tmpfs 253229 20 253209 1% /tmp
cgmfs 253229 5 253224 1% /run/cgmanager/fs
none 253229 3 253226 1% /run/lock
none 253229 23 253206 1% /run/shm
none 253229 2 253227 1% /run/user
tmpfs 253229 1 253228 1% /media
tmpfs 253229 3 253226 1% /var/lib/sudo
tmpfs 253229 64 253165 1% /run/user/32011


Manfred Hampl (m-hampl) said : #3

/dev/disk/by-partlabel/system 3.8G 3.8G 4.0K 100% /

Your root partition is full.
There is free space in /userdata, but that is destined for other tasks by the concept for Ubuntu phones and tablets.

You can try investigating the use of the space in the root partition with a command like
sudo du -schx /*

Chenyang Xu (1063830851-b) said : #4

So is there any way to make my root partition larger ? I do not need so much free space in /userdata


Manfred Hampl (m-hampl) said : #5

It might be possible to use tools like gparted and/or clonezilla, but I have never tried such action on a tablet.

You have to be aware that you are deviating from the standards for Ubuntu touch devices.

Does the "sudo du -schx /*" command give an indication where the space is used?

Chenyang Xu (1063830851-b) said : #6

The output of "sudo du -schx /*" is :

0 /android
6.7M /bin
4.0K /boot
0 /cache
1.8G /custom
0 /data
4.0K /dev
6.3M /etc
0 /factory
0 /firmware
807M /home
33M /lib
4.0K /lost+found
0 /media
4.0K /mnt
4.0K /opt
0 /persist
0 /proc
12K /root
564K /run
7.2M /sbin
4.0K /srv
0 /sys
0 /system
32K /tmp
261M /userdata
1.4G /usr
617M /var
0 /vendor
4.8G total

But I have no idea that what I should do...


Manfred Hampl (m-hampl) said : #7

The largest ones are
/custom (1.8GB), /usr (1.4GB) and /home (0.8GB)

What do you get for
sudo du -schx /custom/*
sudo du -schx /usr/*
sudo du -schx /home/*

Chenyang Xu (1063830851-b) said : #8

The output is :

sudo du -schx /custom/* :

4.0K /custom/build_id
5.2M /custom/cache
1.7G /custom/click
4.0K /custom/default_language
4.0K /custom/etc
16K /custom/home
1.2M /custom/lib
4.0K /custom/partner-id
1.1M /custom/usr
3.1M /custom/vendor
40K /custom/xdg
1.8G total

sudo du -schx /usr/*:

91M /usr/bin
4.0K /usr/games
34M /usr/include
652M /usr/lib
100K /usr/local
9.4M /usr/sbin
635M /usr/share
4.0K /usr/src
1.4G total

sudo du -schx /home/* :

807M /home/phablet
807M total


ok and the output of:

du -sh /home/phablet/*


You have very little space on the system. Keeping packages down is essential to avoid this. Also what is the output of:

sudo apt-get clean; lsb_release -a; uname -a; dpkg -l | grep linux-image


Chenyang Xu (1063830851-b) said : #10

The output is :

du -sh /home/phablet/* :
72M /home/phablet/Documents
258M /home/phablet/Downloads
4.0K /home/phablet/Music
1.2M /home/phablet/Pictures
108M /home/phablet/PYTHON
8.0K /home/phablet/Videos

Actually, I dont know why, when I use "sudo apt-get clean", then I install "pip" successfully, maybe this command free some space in my tablet, but I still worry that I may fail to install other things, so I want to find some way to make my system space larger.


Manfred Hampl (m-hampl) said : #11

I assume that the directories
258M /home/phablet/Downloads
108M /home/phablet/PYTHON
72M /home/phablet/Documents
could be good candidates for cleanup to free up space, as well as /var/cache/

And back to your general question: What you want to do is a deviation from the concepts for Ubuntu touch. You are doing that on your own risk and within your own responsibility.

If you need more space on a partition you can
1. delete files from that partition or
2. increase the size of the partition.
I have no experience in the use of partitioning tools on a Ubuntu touch device and I doubt that you will find much information about that topic at all.

Chenyang Xu (1063830851-b) said : #12

Thank you for your help!