How to fix the problem when the disk is full while running apt-get?
Douglas Stanley
douglas.m.stanley at gmail.com
Mon May 25 14:06:43 UTC 2015
You'll need to free up some disk space first. If it's your /boot partition
(that happens to me all the time), you can delete some files you don't need
any longer in /boot. Well, some you can't delete, but you can replace them
with zero length files of the same name.
First, figure out what kernel is actually running, use the uname command
and note the version you're running. Then go into the /boot directory, and
any of the initrd files that are from older kernel versions, you can safely
replace with files of zero size. I forget if the uninstall process will
fail if it can't remove initrd files, so to be on the safe side, delete the
file and then use the touch command to make an empty file with the same
name as the one you deleted.
You should only need to purge one or two of the old initrd files and you
should be able to finish your apt-get -f install.
After you get the apt-get -f install finished, go through the list of all
installed kernel packages, and apt-get purge all of the ones you don't
need. Keep just the version you're currently running, and what ever is the
latest version that was just installed. Purge all the rest of then. That
should free up plenty of disk space going forward
Sadly, it doesn't seem like there are any easy ways to automatically do
this process that I know of currently. Maybe someone else does though.
Hope that helps,
Doug
On May 25, 2015 9:53 AM, "Peng Yu" <pengyu.ut at gmail.com> wrote:
> Hi, My disk is full. So I get the following error message.
>
> $ sudo apt-get -f install
> 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:
> linux-headers-3.13.0-27 linux-headers-3.13.0-27-generic
> linux-headers-3.13.0-29 linux-headers-3.13.0-29-generic
> linux-headers-3.13.0-30 linux-headers-3.13.0-30-generic
> linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
> linux-headers-3.13.0-34 linux-image-3.11.0-20-generic
> linux-image-3.13.0-27-generic linux-image-3.13.0-29-generic
> linux-image-3.13.0-30-generic linux-image-3.13.0-32-generic
> linux-image-3.13.0-34-generic linux-image-extra-3.11.0-20-generic
> linux-image-extra-3.13.0-27-generic linux-image-extra-3.13.0-29-generic
> linux-image-extra-3.13.0-30-generic linux-image-extra-3.13.0-32-generic
> linux-image-extra-3.13.0-34-generic
> Use 'apt-get autoremove' to remove them.
> The following extra packages will be installed:
> linux-headers-3.13.0-53 linux-headers-3.13.0-53-generic
> The following NEW packages will be installed:
> linux-headers-3.13.0-53 linux-headers-3.13.0-53-generic
> 0 upgraded, 2 newly installed, 0 to remove and 159 not upgraded.
> 8 not fully installed or removed.
> Need to get 0 B/9,575 kB of archives.
> After this operation, 76.8 MB of additional disk space will be used.
> Do you want to continue? [Y/n] Y
> (Reading database ... 233862 files and directories currently installed.)
> Preparing to unpack .../linux-headers-3.13.0-53_3.13.0-53.89_all.deb ...
> Unpacking linux-headers-3.13.0-53 (3.13.0-53.89) ...
> dpkg: error processing archive
> /var/cache/apt/archives/linux-headers-3.13.0-53_3.13.0-53.89_all.deb
> (--unpack):
> unable to create
>
> `/usr/src/linux-headers-3.13.0-53/arch/x86/include/asm/unaligned.h.dpkg-new'
> (while processing
> `./usr/src/linux-headers-3.13.0-53/arch/x86/include/asm/unaligned.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-53-generic_3.13.0-53.89_amd64.deb ...
> Unpacking linux-headers-3.13.0-53-generic (3.13.0-53.89) ...
> dpkg: error processing archive
>
> /var/cache/apt/archives/linux-headers-3.13.0-53-generic_3.13.0-53.89_amd64.deb
> (--unpack):
> unable to create
>
> `/usr/src/linux-headers-3.13.0-53-generic/include/config/sched/mc.h.dpkg-new'
> (while processing
> `./usr/src/linux-headers-3.13.0-53-generic/include/config/sched/mc.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)
> Errors were encountered while processing:
> /var/cache/apt/archives/linux-headers-3.13.0-53_3.13.0-53.89_all.deb
>
> /var/cache/apt/archives/linux-headers-3.13.0-53-generic_3.13.0-53.89_amd64.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> But when I try to run autoremove, it asks me to run apt-get -f
> install. How to fix this problem?
>
> $ sudo apt-get autoremove
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> You might want to run 'apt-get -f install' to correct these.
> The following packages have unmet dependencies:
> linux-headers-generic : Depends: linux-headers-3.13.0-53-generic but
> it is not installed
> E: Unmet dependencies. Try using -f.
> --
> Regards,
> Peng
>
> --
> ubuntu-server mailing list
> ubuntu-server at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
> More info: https://wiki.ubuntu.com/ServerTeam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-server/attachments/20150525/4366c5c0/attachment.html>
More information about the ubuntu-server
mailing list