Problem at last update Initramfs-tools


(DownSec) #1

Briefly describe your issue below:

Hello guys,

since the last update, i don’t have enough space in the /boot folder to allow installation.

As you can see in the folder, there are several files with the same name. I would like to know if I can safely delete them, in order to perform the update correctly?

Thanks in advance :wink:

01

What version of Parrot are you running? (include version, edition, and architecture)
Linux parrot 4.18.0-parrot10-amd64 #1 SMP Debian 4.18.10-1parrot10 (2018-10-06) x86_64 GNU/Linux

What method did you use to install Parrot? (Debian Standard / Debian GTK / parrot-experimental)
Debian GTK

Configured to multiboot with other systems? (yes / no)
No

If there are any similar issues or solutions, link to them below:

But no confirmation on my question…

If there are any error messages or relevant logs, post them below:


(Matt) #2

You can use uname -r to see which kernel version you are currently using.

Follow this https://help.ubuntu.com/community/RemoveOldKernels or google ‘removing old kernels’/ ‘linux /boot full’.
Ideally you keep a few (3 is default). But if /boot is in its own partition then you gotta do, what you gotta do.


#3

Im Having The Same Particular Issue. Same Error & Im Having It From A Couple Of Weeks Now. Googled a couple of solutions like sudo apt-get autoremove or sudo apt-get autoremove --purge but none of them worked. The out come was the same error the main claimant of this thread.

What method did you use to install Parrot? (Debian Standard / Debian GTK / parrot-experimental)
Debian GTK
Configured to multiboot with other systems? (yes / no)
No
Using LVM Encrypted Partiotions

Error :
sudo su
apt-get autoremove -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 463 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.132) …
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.132) …
update-initramfs: Generating /boot/initrd.img-4.18.0-parrot20-amd64

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.18.0-parrot20-amd64 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
Configuring sandbox profiles…
Sandbox profiles updated!
E: Sub-process /usr/bin/dpkg returned an error code (1)

More digging :

cd /boot
ls
config-4.18.0-parrot10-amd64 initrd.img-4.18.0-parrot20-amd64
config-4.18.0-parrot20-amd64 lost+found
efi System.map-4.18.0-parrot10-amd64
grub System.map-4.18.0-parrot20-amd64
initrd.img-4.18.0-parrot10-amd64 vmlinuz-4.18.0-parrot10-amd64
initrd.img-4.18.0-parrot10-amd64.old-dkms vmlinuz-4.18.0-parrot20-amd64

uname -r
4.18.0-parrot20-amd64

tried to do this as someone said but didnt work out either:

cd /boot
ls
sudo apt-get purge initrd.img-4.18.0-parrot10-amd64.old-dkms
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package initrd.img-4.18.0-parrot10-amd64.old-dkms
E: Couldn’t find any package by glob ‘initrd.img-4.18.0-parrot10-amd64.old-dkms’
E: Couldn’t find any package by regex ‘initrd.img-4.18.0-parrot10-amd64.old-dkms’

Is there a manual way to remove the old images? If yes then How & what images should i remove?
Keep in mind that im fairly new to Linux so please be as eloborative as possible while explaining the solution.

Appreiciation In Advance :slight_smile:


(Matt) #4

So this should list installed kernels you are not using:
dpkg -l | grep -e "ii linux-image-[0-9]" | grep -v $(uname -r)
(note 2 spaces between ‘ii’ and ‘linux’)

dpkg -l — list packages
grep -e — only show lines containing that string
grep -v — exclude current kernel from list

Then you can remove the kernels in that list. sudo apt-get purge <image>
You can also remove the .old-dkms files, simply sudo rm /boot/*old-dkms, although they should be removed when you purge the old kernel.

I would recommend increasing the size of you boot partition, if you dont want to do this to frequently. This will also remove the risk of you accidentally ‘soft bricking’ the OS, by removing the wrong kernel.


#5

@KidKlown

Outcome:

ii linux-image-4.18.0-parrot10-amd64 4.18.10-2parrot10 amd64 Linux 4.18 for 64-bit PCs

Now cd /boot
ls
Outcome:

config-4.18.0-parrot10-amd64 initrd.img-4.18.0-parrot20-amd64
config-4.18.0-parrot20-amd64 lost+found
efi System.map-4.18.0-parrot10-amd64
grub System.map-4.18.0-parrot20-amd64
initrd.img-4.18.0-parrot10-amd64 vmlinuz-4.18.0-parrot10-amd64
initrd.img-4.18.0-parrot10-amd64.old-dkms vmlinuz-4.18.0-parrot20-amd64

What am i exactly supposed to remove and using what command?

P.S How do i increase the size of /boot. Keep in mind im Luks. Heres how my drive is divided :

Filesystem 1K-blocks Used Available Use% Mounted on
udev 4017284 0 4017284 0% /dev
tmpfs 809352 17624 791728 3% /run
/dev/mapper/parrot–vg-root 932203468 106573772 778206620 13% /
tmpfs 4046756 1876 4044880 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 4046756 0 4046756 0% /sys/fs/cgroup
/dev/sda2 241965 194981 34492 85% /boot
/dev/sda1 523248 4868 518380 1% /boot/efi
tmpfs 809348 48 809300 1% /run/user/1000

Really Appriciate You For Helping Out :smile:


(Matt) #6

Use:
apt-get purge linux-image-4.18.0-parrot10-amd64

Cleaning out /boot doesnt take too long and you wont have to do it that often.

Resizing LUK’s would be a pain. Easiest option would be to just re-install and make /boot larger.


#7

This helped out. ThankYou <3 :blush:

Can you teach me how to identify old images so that next time if this issue appears i can resolve it myself :smile:

Thanks Again! @KidKlown


(Amzker Pro Hacker) #8

There is written see
Parrot10
Parrot8
So understand now which is old


(Matt) #9

Use this or just manually compare uname -r with the content of /boot

Then you get an output like
ii linux-image-4.18.0-parrot10-amd64 4.18.10-2parrot10 amd64 Linux 4.18 for 64-bit PCs
right after ‘ii’ is the kernel name that you can remove (‘linux-image-4.18.0-parrot10-amd64’)

So then take that name and put it after apt-get purge e.g. apt-get purge linux-image-4.18.0-parrot10-amd64


#10

its been maybe a month but the same previous issue has occured.

I followed the previously mentioned steps and the out come of dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r) is :
ii linux-image-4.18.0-parrot20-amd64 4.18.20-2parrot20

WHat shall i do now? which image should i remove and with which command?

cd /boot
ls
config-4.18.0-parrot20-amd64
config-4.19.0-parrot1-13t-amd64
efi
grub
initrd.img-4.18.0-parrot20-amd64
initrd.img-4.19.0-parrot1-13t-amd64
initrd.img-4.19.0-parrot1-13t-amd64.dpkg-bak
initrd.img-4.19.0-parrot1-13t-amd64.new
initrd.img-4.19.0-parrot1-13t-amd64.old-dkms
lost+found
System.map-4.18.0-parrot20-amd64
System.map-4.19.0-parrot1-13t-amd64
vmlinuz-4.18.0-parrot20-amd64
vmlinuz-4.19.0-parrot1-13t-amd64

help is welcomed :slight_smile: @KidKlown @Amzker


(Matt) #11

Its the same as before.

I will try to make it easier using a new command chain. But the more i chain together, the more that can go wrong. So make sure you backup anything important before hand.

If the command i gave you before

dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r)

outputs this:
ii linux-image-4.18.0-parrot20-amd64 4.18.20-2parrot20

Then this command

dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r) -m 1 | cut -d' ' -f3

should output this:

linux-image-4.18.0-parrot20-amd64

and make sure that it doesn’t match the output of uname -r.

Just check that is correct before proceeding.

Then we can try another command that should remove it for you. In theory you should be able to use this command every time. But personally i would check the output each time, just in case.
Running this should remove it for you:

sudo apt-get purge $(dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r) -m 1 | cut -d' ' -f3)

#12

Thank You For Reaching Back. @KidKlown

The Command :
dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r) [With Double space between ii and linux as well as without double space]

gives out error
“grep: linux-image-[0-9]”: No such file or directory”

The command :

dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r) -m 1 | cut -d’ ’ -f3

Screenshot%20at%202019-02-19%2009-56-53

gives out same error as the one mentioned above.
grep: linux-image-[0-9]”: No such file or directory.
Ran both the commands with and without root. same outcome.
Is there any hope left :disappointed_relieved:


(Matt) #13

Use single quotes (replace the " with ’ ).

If you dont want to mess around with the command, just use apt-get purge linux-image-4.18.0-parrot20-amd64.

But the commands will hopefully allow you to do it yourself each time.


#14

Single Quote Worked! @KidKlown

Outcome of this command : dpkg -l | grep -e ‘ii linux-image-[0-9]’ | grep -v $(uname -r)

is

ii linux-image-4.18.0-parrot20-amd64 4.18.20-2parrot20 amd64 Linux 4.18 for 64-bit PCs

And Outcome of this command :

dpkg -l | grep -e ‘ii linux-image-[0-9]’ | grep -v $(uname -r) -m 1 | cut -d’ ’ -f3

is

linux-image-4.18.0-parrot20-amd64

Wouldnt this mess up my laptop?

P.S ive attached the error snapshots above and is there any way i could change to 4.18 to 4.19 since i have the4.19 in /boot. heres the entire dir

config-4.18.0-parrot20-amd64
config-4.19.0-parrot1-13t-amd64
efi
grub
initrd.img-4.18.0-parrot20-amd64
initrd.img-4.19.0-parrot1-13t-amd64
initrd.img-4.19.0-parrot1-13t-amd64.dpkg-bak
initrd.img-4.19.0-parrot1-13t-amd64.new
initrd.img-4.19.0-parrot1-13t-amd64.old-dkms
lost+found
System.map-4.18.0-parrot20-amd64
System.map-4.19.0-parrot1-13t-amd64
vmlinuz-4.18.0-parrot20-amd64
vmlinuz-4.19.0-parrot1-13t-amd64


(Matt) #15

Yep that looks good.

Yeah the errors dont matter, i just typed it out wrong.

Nope, its what we did before if you read up the thread. Just this time its with a different kernel.

So my piping into apt doesnt work atm. So just use apt-get purge linux-image-4.18.0-parrot20-amd64, i will try to fix my other command for next time.


#16

Welp. Another error :tired_face: @KidKlown

22


(Matt) #17

Run the command it says.

My other command didnt work because i wasnt using echo .
So it would be sudo apt-get purge $(echo $(dpkg -l | grep -e “ii linux-image-[0-9]” | grep -v $(uname -r) -m 1 | cut -d' ' -f3))


#18

Annnnnd Another Error.

It was huge so i pasted on pastebin instead of here.
https://pastebin.com/YE9tAD5n

Also, i got a popup saying that the volume 'boot" has only 6mb left. examine the volume.

I feel like im digging myself deeper

Save me senpai @KidKlown


(Matt) #19

Ok this is just the same problem.

Give me the output of:
dpkg -l | grep -e 'ii linux-image-[0-9]'
and
ls /boot/
and
uname -r


#20

config-4.18.0-parrot20-amd64 grub initrd.img-4.19.0-parrot1-13t-amd64.old-dkms System.map-4.19.0-parrot1-13t-amd64
config-4.19.0-parrot1-13t-amd64 initrd.img-4.18.0-parrot20-amd64 lost+found vmlinuz-4.18.0-parrot20-amd64
efi initrd.img-4.19.0-parrot1-13t-amd64 System.map-4.18.0-parrot20-amd64 vmlinuz-4.19.0-parrot1-13t-amd64

@KidKlown