cannot clean boot partition

linux.girl

New Member
Joined
Dec 9, 2018
Messages
4
Reaction score
3
Credits
0
Hello dear community - in case the question comes out unreadable, I attached it here in txt format so it is easier to read.

I tried to upgrade my ubuntu 18.4 to 18.10. At the end, it tells me it cannot continue because I don't have enough disk space on /boot and therefore it did only a partial update. I reboot the system and 18.10 appears, but tells me it is only a partial upgrade because not enough disk space on /boot.

I try to free disk space and get this error:

apt autoremove
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

Tried many things, nothing helped, i.e., tried to kill the process, but the process number kept changing and reapearing every time I killed it.

df -hT
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 3.2G 3.5M 3.2G 1% /run
/dev/mapper/ubuntu--vg-root ext4 886G 646G 195G 77% /
tmpfs tmpfs 16G 28M 16G 1% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 ext2 236M 220M 4.2M 99% /boot
tmpfs tmpfs 3.2G 16K 3.2G 1% /run/user/124
tmpfs tmpfs 3.2G 36K 3.2G 1% /run/user/1000


dpkg -l linux-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================================-===========================-===========================-===============================================================================================
ii linux-base 4.5ubuntu1 all Linux image base package
un linux-doc-3.11.0 <none> <none> (no description available)
un linux-doc-3.13.0 <none> <none> (no description available)
un linux-doc-4.15.0 <none> <none> (no description available)
un linux-doc-4.4.0 <none> <none> (no description available)
ii linux-firmware 1.175 all Firmware for Linux kernel drivers
un linux-firmware-snapdragon <none> <none> (no description available)
ii linux-generic 4.15.0.39.41 amd64 Complete Generic Linux kernel and headers
un linux-headers <none> <none> (no description available)
un linux-headers-3.0 <none> <none> (no description available)
un linux-headers-3.11.0-19-generic <none> <none> (no description available)
un linux-headers-3.11.0-20-generic <none> <none> (no description available)
un linux-headers-3.11.0-22-generic <none> <none> (no description available)
un linux-headers-3.13.0-93-generic <none> <none> (no description available)
ii linux-headers-4.15.0-39 4.15.0-39.42 all Header files related to Linux kernel version 4.15.0
ii linux-headers-4.15.0-39-generic 4.15.0-39.42 amd64 Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
un linux-headers-4.4.0-34-generic <none> <none> (no description available)
un linux-headers-4.4.0-38-generic <none> <none> (no description available)
un linux-headers-4.4.0-42-generic <none> <none> (no description available)
un linux-headers-4.4.0-47-generic <none> <none> (no description available)
un linux-headers-4.4.0-51-generic <none> <none> (no description available)
un linux-headers-4.4.0-62-generic <none> <none> (no description available)
un linux-headers-4.4.0-63-generic <none> <none> (no description available)
un linux-headers-4.4.0-64-generic <none> <none> (no description available)
un linux-headers-4.4.0-66-generic <none> <none> (no description available)
un linux-headers-4.4.0-71-generic <none> <none> (no description available)
un linux-headers-686-pae <none> <none> (no description available)
un linux-headers-amd64 <none> <none> (no description available)
ii linux-headers-generic 4.15.0.39.41 amd64 Generic Linux kernel headers
un linux-image <none> <none> (no description available)
un linux-image-3.0 <none> <none> (no description available)
rc linux-image-3.11.0-19-generic 3.11.0-19.33 amd64 Linux kernel image for version 3.11.0 on 64 bit x86 SMP
rc linux-image-3.11.0-20-generic 3.11.0-20.35 amd64 Linux kernel image for version 3.11.0 on 64 bit x86 SMP
rc linux-image-3.11.0-22-generic 3.11.0-22.38 amd64 Linux kernel image for version 3.11.0 on 64 bit x86 SMP
rc linux-image-3.13.0-93-generic 3.13.0-93.140 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-4.15.0-39-generic 4.15.0-39.42 amd64 Signed kernel image generic
rc linux-image-4.4.0-34-generic 4.4.0-34.53 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-38-generic 4.4.0-38.57 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-42-generic 4.4.0-42.62 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-47-generic 4.4.0-47.68 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-51-generic 4.4.0-51.72 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-62-generic 4.4.0-62.83 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-63-generic 4.4.0-63.84 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-64-generic 4.4.0-64.85 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-66-generic 4.4.0-66.87 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-4.4.0-71-generic 4.4.0-71.92 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
un linux-image-4.4.0-79-generic <none> <none> (no description available)
un linux-image-4.4.0-91-generic <none> <none> (no description available)
rc linux-image-extra-3.11.0-19-generic 3.11.0-19.33 amd64 Linux kernel extra modules for version 3.11.0 on 64 bit x86 SMP
rc linux-image-extra-3.11.0-20-generic 3.11.0-20.35 amd64 Linux kernel extra modules for version 3.11.0 on 64 bit x86 SMP
rc linux-image-extra-3.11.0-22-generic 3.11.0-22.38 amd64 Linux kernel extra modules for version 3.11.0 on 64 bit x86 SMP
rc linux-image-extra-3.13.0-93-generic 3.13.0-93.140 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-34-generic 4.4.0-34.53 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-38-generic 4.4.0-38.57 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-42-generic 4.4.0-42.62 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-47-generic 4.4.0-47.68 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-51-generic 4.4.0-51.72 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-62-generic 4.4.0-62.83 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-63-generic 4.4.0-63.84 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-64-generic 4.4.0-64.85 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-66-generic 4.4.0-66.87 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-71-generic 4.4.0-71.92 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-79-generic 4.4.0-79.100 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-91-generic 4.4.0-91.114 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-generic 4.15.0.39.41 amd64 Generic Linux kernel image
un linux-image-unsigned-4.15.0-39-generic <none> <none> (no description available)
un linux-initramfs-tool <none> <none> (no description available)
un linux-kernel-log-daemon <none> <none> (no description available)
ii linux-modules-4.15.0-39-generic 4.15.0-39.42 amd64 Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii linux-modules-extra-4.15.0-39-generic 4.15.0-39.42 amd64 Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
un linux-restricted-common <none> <none> (no description available)
ii linux-sound-base 1.0.25+dfsg-0ubuntu5 all base package for ALSA and OSS sound systems
un linux-source-3.11.0 <none> <none> (no description available)
un linux-source-3.13.0 <none> <none> (no description available)
un linux-source-4.15.0 <none> <none> (no description available)
un linux-source-4.4.0 <none> <none> (no description available)
un linux-tools <none> <none> (no description available)

Even when I try to remove manually it doesn't work:



apt-get purge linux-image-3.11.0-19-generic

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages will be REMOVED:

linux-image-3.11.0-19-generic*

0 upgraded, 0 newly installed, 1 to remove and 7 not upgraded.

1 not fully installed or removed.

After this operation, 0 B of additional disk space will be used.

Do you want to continue? [Y/n] y

Setting up initramfs-tools (0.131ubuntu15) ...

update-initramfs: deferring update (trigger activated)

dpkg: warning: files list file for package 'sphinx-voxforge-hmm-en' missing; assuming package has no files currently installed

dpkg: warning: files list file for package 'unity-scope-gmusicbrowser'
missing; assuming package has no files currently installed

dpkg: warning: files list file for package 'sgml-data' missing; assuming package has no files currently installed

dpkg: warning: files list file for package 'sphinx-voxforge-lm-en' missing; assuming package has no files currently installed

dpkg: warning: files list file for package 'libapt-pkg4.12:amd64' missing; assuming package has no files currently installed

(Reading database ... 220464 files and directories currently installed.)

Purging configuration files for linux-image-3.11.0-19-generic (3.11.0-19.33) ...

Examining /etc/kernel/postrm.d .

run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.11.0-19-generic /boot/vmlinuz-3.11.0-19-generic

run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.11.0-19-generic /boot/vmlinuz-3.11.0-19-generic

Processing triggers for initramfs-tools (0.131ubuntu15) ...

update-initramfs: Generating /boot/initrd.img-4.15.0-39-generic

gzip: stdout: No space left on device

E: mkinitramfs failure cpio 141 gzip 1

update-initramfs: failed for /boot/initrd.img-4.15.0-39-generic with 1.

dpkg: error processing package initramfs-tools (--configure):

installed initramfs-tools package post-installation script subprocess returned error exit status 1

Errors were encountered while processing:

initramfs-tools

E: Sub-process /usr/bin/dpkg returned an error code (1)

Then I do :dpkg -l linux-*

And see that what I tried to remove is still there. Same if I try with rm -rf.



What do I do??
 

Attachments

  • Boot_Partition_Problem.txt
    15.3 KB · Views: 654


Hi @linux.girl and welcome to linux.org :)

1. Are you planning to or could you close your Thread at Ubuntu here? It can cause confusion with conflicting advice.

https://askubuntu.com/questions/1099581/problem-cleaning-boot-partition

2. Have a read of this

https://github.com/LIS/LISAv2/issues/449

Might be what you are experiencing? That was 12 days ago and is a work in progress, there have been hiccups with this protocol since it was implemented earlier this year.

It is also related to unattended-upgrades, and so if you turn off your u-a that might improve the situation.

Files such as, in this instance, /var/lib/dpkg/lock-frontend and other examples such as /var/cache/apt/archives/lock typically have zero bytes and can be deleted, although they will reappear the next time certain conditions are met.

In the case of the latter example, it typically occurs if you commence a session in Linux Mint or Ubuntu &c, and go to install software at Terminal, prior to the GUI Update Manager appearing with notifications that software is available. This is cause by a conflict of install attempt vs Updates, both involving Synaptic Package Manager, which involves apt.

So in your case, as soon as you get the message again, you could try

Code:
sudo rm /var/lib/dpkg/lock-frontend

and then see if you can complete your cleanup process, but I have only used this with lock, not lock-frontend, yet, so I cannot say that the process will not reappear.

Your simplest course of action might be to reinstall and get rid of all the baggage.

Then install Timeshift, so that you can rollback when needed.

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241/

Cheers

Chris Turner
wizardfromoz
 
Hi @linux.girl and welcome to linux.org :)

1. Are you planning to or could you close your Thread at Ubuntu here? It can cause confusion with conflicting advice.

https://askubuntu.com/questions/1099581/problem-cleaning-boot-partition

2. Have a read of this

https://github.com/LIS/LISAv2/issues/449

Might be what you are experiencing? That was 12 days ago and is a work in progress, there have been hiccups with this protocol since it was implemented earlier this year.

It is also related to unattended-upgrades, and so if you turn off your u-a that might improve the situation.

Files such as, in this instance, /var/lib/dpkg/lock-frontend and other examples such as /var/cache/apt/archives/lock typically have zero bytes and can be deleted, although they will reappear the next time certain conditions are met.

In the case of the latter example, it typically occurs if you commence a session in Linux Mint or Ubuntu &c, and go to install software at Terminal, prior to the GUI Update Manager appearing with notifications that software is available. This is cause by a conflict of install attempt vs Updates, both involving Synaptic Package Manager, which involves apt.

So in your case, as soon as you get the message again, you could try

Code:
sudo rm /var/lib/dpkg/lock-frontend

and then see if you can complete your cleanup process, but I have only used this with lock, not lock-frontend, yet, so I cannot say that the process will not reappear.

Your simplest course of action might be to reinstall and get rid of all the baggage.

Then install Timeshift, so that you can rollback when needed.

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241/

Cheers

Chris Turner
wizardfromoz

Hi there, thank you so much for taking the time to answer. I decided to re-install it from scratch because the system is really full of garbage from over the years. I will not delete my question on ubuntu because different people visit different forums and might have different ideas. Hope it is OK :)

Question, maybe you know: I use LVM on my system, so the boot partition is usually very small - do you know of a away to avoid it from storing so many old and obsolete kernels?

Thank you for the warm welcome and kind regards!
 
Hey there linux.girl.

After looking around a bit, removing old/unused kernels in ubuntu can be done easily with the 'purge-old-kernels' utility that comes with the byobu package..

So, first, install byubu:
Code:
sudo apt install byobu

Then, run the command:
Code:
sudo purge-old-kernels --keep 2

It's recommended to keep at least 2 in case you need to boot on the last one that worked.
 
Hello linux.girl,

I keep 2 kernels the original installed working kernel and the latest updated working kernel and no others.

Kernels can easily be removed using synaptic package manager.

The reason for keeping the original installed working kernel is so you always have a known good working kernel to fall back to in case a new updated kernel fails to work.
 
Hope it is OK :)

That is fine, as long as you don't expect for us to be mindreaders (well I am, but I am a 5,000 year old wizard):D:D

If you learn anything new there, you could always bring a bit of it back to help our readers as well ;)

Enjoy your Linux

Wizard

BTW if you get an opportunity, swing over to Member Introductions and say Hi. You'll meet a few of the Gang.
 
Friends, thank you so so much for all the help. I am sorry it took me so long to answer, I was ill. Unfortunately my PC was so messed up that I decided to install it all from scratch. I will see how it goes. I want very much to contribute to the community and give it back. I really appreciate your help and don't take it for granted!
 

Members online


Latest posts

Top