0

Yeah, I searched and searched and tried and tried, and now I'm posting ...

A couple weeks ago, I did a regular update of my 14.04.5 LTS system, and now it's giving me the error "package system is broken". It says to try two things:

  1. Disable any third party PPAs. I checked my sources list (in the Ubuntu Software Center) and there weren't any. They're all ubuntu.com sources. OK, no, there is a Google source, but disabling it didn't help anything.

  2. Run "sudo apt-get install -f", which gave me the output below. That output implies that my disk is full, but according to df it is definitely not. Seems like the problem is elsewhere but it's causing apt-get to think the drive is full.

Any ideas?

command-prompt$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  account-plugin-windows-live gir1.2-gnomekeyring-1.0 gir1.2-rb-3.0
  gir1.2-secret-1 libdmapsharing-3.0-2 libgpod-common libgpod4 libhdb9-heimdal
  libkdc2-heimdal libllvm3.5 libntdb1 librhythmbox-core8 libsgutils2-2
  libupstart1 linux-headers-3.13.0-117 linux-headers-3.13.0-117-generic
  linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic
  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic linux-headers-4.4.0-45
  linux-headers-4.4.0-45-generic linux-headers-4.4.0-64
  linux-headers-4.4.0-64-generic linux-image-3.16.0-30-generic
  linux-image-4.4.0-34-generic linux-image-4.4.0-64-generic
  linux-image-extra-3.16.0-30-generic linux-image-extra-4.4.0-34-generic
  linux-image-extra-4.4.0-64-generic media-player-info python-ntdb
  python3-mako python3-markupsafe rhythmbox-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-headers-3.13.0-129 linux-headers-3.13.0-129-generic
  linux-headers-4.4.0-91
The following NEW packages will be installed:
  linux-headers-3.13.0-129 linux-headers-3.13.0-129-generic
  linux-headers-4.4.0-91
0 upgraded, 3 newly installed, 0 to remove and 49 not upgraded.
4 not fully installed or removed.
Need to get 0 B/19.5 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 1695950 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.4.0-91_4.4.0-91.114~14.04.1_all.deb ...
Unpacking linux-headers-4.4.0-91 (4.4.0-91.114~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0-91_4.4.0-91.114~14.04.1_all.deb (--unpack):
 unable to create `/usr/src/linux-headers-4.4.0-91/drivers/staging/android/ion/Makefile.dpkg-new' (while processing `./usr/src/linux-headers-4.4.0-91/drivers/staging/android/ion/Makefile'): No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../linux-headers-3.13.0-129_3.13.0-129.178_all.deb ...
Unpacking linux-headers-3.13.0-129 (3.13.0-129.178) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.13.0-129_3.13.0-129.178_all.deb (--unpack):
 unable to create `/usr/src/linux-headers-3.13.0-129/arch/mips/include/asm/lasat/head.h.dpkg-new' (while processing `./usr/src/linux-headers-3.13.0-129/arch/mips/include/asm/lasat/head.h'): No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../linux-headers-3.13.0-129-generic_3.13.0-129.178_amd64.deb ...
Unpacking linux-headers-3.13.0-129-generic (3.13.0-129.178) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.13.0-129-generic_3.13.0-129.178_amd64.deb (--unpack):
 error creating directory `./usr/src/linux-headers-3.13.0-129-generic/include/config/module/sig': No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-headers-4.4.0-91_4.4.0-91.114~14.04.1_all.deb
 /var/cache/apt/archives/linux-headers-3.13.0-129_3.13.0-129.178_all.deb
 /var/cache/apt/archives/linux-headers-3.13.0-129-generic_3.13.0-129.178_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
0

Per the first answer in apt-get: No space left on device (12.04) your system may have run out of inode's. Compare the output of df -ih to df -h.

From 'apt-get install -f' output your system has a moderate amount of old packages that can be auto removed. This may allow the update to run properly.

Run sudo apt-get autoremove. Run df -h and df -ih to compare the two outputs. Consider posting the before and after results.

If apt-get autoremove does not free enough inode's, you may need to free some by archiving some files. du ~/ | sort -n | head -n 10 will list the 10 smallest files in the current users home dir. Archiving or deleting many small files will give the most bang for the effort, in freeing inodes.

0

Looks like your sources file is corrupted and there are broken packages. Remove the corrupted source file by pressing Ctrl + Alt + T to open a terminal, and type in:

sudo rm /etc/apt/sources.list

Then, type in

sudo software-properties-gtk

This will open software-properties-gtk and a new sources.list will be created automatically.

Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list.

Tick all the boxes then click on Revert then click close.

sudo apt-get update && sudo apt-get dist-upgrade -y

E: Sub-process /usr/bin/dpkg returned an error code (1) [related to google chrome]

  • Thanks! Two followup questions: 1. Instead of software-properties-gtk (which sounds like a graphical frontend), can I use the Ubuntu Software Center to recreate the sources list? 2. Can you confirm that "apt-get dist-upgrade" is NOT updating to a newer release? – Chris C. Sep 5 '17 at 3:54
  • Open the software center, then from the Edit menu select "Software Sources". dist-upgrade will not upgrade to a new Ubuntu release. It will just install available updates for the Ubuntu release you already have installed. It may install new packages or remove installed packages if that is necessary to satisfy dependencies. – user732773 Sep 5 '17 at 4:11
0

do a df -hi to check disk-full status; I bet you have no inodes left; thus no new files can be written, no files extended (no files made larger). -i means show inode info (think blocks, clusters...).

no doubt you did something like creating lots of tiny log/email files & it used all inodes and the 'disk is full' as no more files can be written (even if some space is unallocated; inodes all used up!). inodes are allocated on format; but look for a directory that's filled with tens of thousands of more of small files, and delete the unwanted crap or at least move to a non-system volume and ideally limit your logs/emails or whatever it is to have a more sustainable limit (number set by your disk type, capacity, etc) etc.

  • You are right! df -hi output includes: /dev/sda4 1.7M 1.7M 5.2K 100% / Is there a way to find the offending directory? – Chris C. Sep 5 '17 at 3:55
  • And a reboot would not fix this, right? I'm pretty sure I already tried that. Just confirming. – Chris C. Sep 5 '17 at 3:57
  • use the du --inode command to show disk-usage; for me i'd likely also use -hs to to limit myself to summaries (esp. directories) & the -h cause my fingers always type it as I like human-readable (like the df -hi; -h wasn't needed but my fingers typed it). treat it like any other disk-full problem :) – guiverc Sep 5 '17 at 4:19
  • clarification --- i sorta linked inodes & blocks (or clusters) which wasn't probably helpful. I won't define here, but inodes are more like pointers that contains info about the file but not name or actual data; they exist in the directory structure itself (hence format creates them). look up doco for better explanations, eg. linfo.org/inode.html if needed – guiverc Sep 5 '17 at 4:27
0

Thanks for the help everyone!

From df -i (2nd and 3rd answer) I could clearly see that the inodes were all used up:

/dev/sda4 1.7M 1.7M 5.2K 100% /

but I was having trouble finding the offenders. I look in all the usual places, and eventually found that about 50 or so kernels (and headers, and everything) were the likely culprit. Ubuntu Software Center and apt-get were not functional enough to let me remove some, so I went to /usr/src and manually deleted some of the oldest directories. After 2-3 kernels I could see that the inode count was finally heading in the right direction. But USC / apt-get still would not run right. So I deleted another 5 or so, which got me down to:

/dev/sda4 1720320 1595437 124883 93% /

and THEN I was finally able to get USC to repair itself, or at least it's not prompting me anymore. Then finally, within USC, I removed a bunch more linux kernels.

I'm about to reboot the machine and then try a full update of the system ...

EDIT: Update worked! Everything works! Thanks again!

shakes fist at Ubuntu for bringing my computer to its knees TWICE now during a regular upgrade process, because of poor storage system management

looks forward to upgrading to 18.04 LTS when I'll upgrade again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.