Basically I tried to uninstall an old version of the linux kernel, I had like 5 versions installed because it was taking up too much space on my /boot partition and now my PC is bricked, this is what it displays when i try to boot it

Basically I tried to uninstall an old version of the linux kernel

Have you tried using a live ISO, chrooting and installing whatever it was you uninstalled?

@asdflkjasdf@lemmy.ml
creator
link
fedilink
33Y

Nope, how do I chroot and install that? I assume it involves sudo apt install linux kernal whatever?

@ksynwa@lemmy.ml
link
fedilink
8
edit-2
3Y

You should look around to find videos or more comprehensive tutorials for this. This is a useful skill to have if you are Linux user. So many breakages can be solved by using this.

For chrooting you first have to boot a live ISO (you did this for installing Ubuntu). You can use an Ubuntu live ISO but it’s not necessary. It should work with most distros.

Then open the terminal. (Or not. You can do this from the TTY as well.)

After that you mount your file system to a mount point (typically /mnt but can be whatever). You can do this by running the following commands. PLEASE DON’T BLINDLY COPY PASTE. Replace /dev/sda1 with whichever devices is mounted to / for your system:

# mount /dev/sda1 /mnt
# mount -t proc proc /mnt/proc
# mount -t sysfs sys /mnt/sys
# mount -o bind /dev /mnt/dev
# mount -t devpts pts /mnt/dev/pts
# chroot /mnt

After this you should be able to use apt to install whatever you had uninstalled.

Here I am making some assumptions:

  • you are not using disk encryption
  • your / file system is supported by the kernel natively (that you are not using something like zfs)

So if any of these is the case then you will have to adapt accordingly.

When done you can exit the chroot and umount. Then try rebooting to see if the problem is fixed:

# exit
# for point in /mnt{/dev/pts,/dev,/sys,/proc,}; do
>   umount $point
> done
# reboot
@asdflkjasdf@lemmy.ml
creator
link
fedilink
23Y

Thanks, I managed to chroot, now I don’t know how to fix the shit I did. I think I have to fix something in /boot because that’s what I’ve played with, someone told me I’m missing an initramfs file I think. Am I supossed to run sudo apt update initramfs and then delete all the kernel files in /boot that are previous to the linux-image-5.11.0-43 which is the one I’m using?

Oh yeah in that case you will have to mount your boot partition to /mnt/boot before chrooting into /mnt. After that I don’t know how to fix the package in apt (sorry). You can try force reinstalling the package that provides the kernel. Maybe it will regenrate the initramfs.

You shouldn’t manually delete files in /boot.

@asdflkjasdf@lemmy.ml
creator
link
fedilink
23Y

Oh, so I have to umount and mount again mounting first on /mnt/boot and then try to fix it?

Yeah

This might be a bit off-topic for this comment thread, but is reinstalling everything an option ? If you have a backup of your data, this might get you up and running quicker. If you don’t have a backup, you could plug in another drive and copy files using the live media.

@asdflkjasdf@lemmy.ml
creator
link
fedilink
13Y

Yes, but it would imply having to move almost 1TB of files, plus having to reconfigure all my system after reinstalling, which will also take quite a lot and I get to learn a bit from here even though I’m so fucking stressed right now.

Well it looks like you’re in good hands with @ksynwa@lemmy.ml!

10_0
link
fedilink
43Y

How old is that monitor? Just wondering, because it looks very bague white, from the 90s.

@asdflkjasdf@lemmy.ml
creator
link
fedilink
43Y

It’s not one of those tube white monitors, it’s an LCD one but really old and its super fucked up, maybe from the 2000s

What exactly did you delete in the /boot directory?

https://lemmy.ml/post/148990

My advice in the above post is partially the reason this post had to be created 😅

I think your advice seems to mostly be sound. I think the execution of the advice was the problem :)

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

  • 0 users online
  • 5 users / day
  • 20 users / week
  • 27 users / month
  • 16 users / 6 months
  • 20 subscribers
  • 684 Posts
  • 1.7K Comments
  • Modlog