Kali linux stopped loading

Accidentally deleted the file vmlinuz-4.19.0-kali5-amd64 and did not notice it immediately when rebooting, it throws an error /boot/vmlinuz-4.19.0-kali5-amd64 файл не найден. Is it possible to download this file separately somewhere, or do you still need to reinstall the OS ?

Author: Christiana, 2019-08-12

2 answers

Warning: all the manipulations described below can be performed by booting from the live image of any distribution gnu / linux, and mounting the partition on your block device that contains the directory boot from which the file was deleted. I omit the procedures for finding the desired partition and mounting it in order to reduce the size of the response.


You deleted the program itself linux.

Obviously, you should "search" for it in the repository your distribution: https://http.kali.org/kali

The packages themselves are located in the pool directory, the package we are interested in is located, of course, in the main section (well, in what other section can the linux program be placed? given that some pranksters are absolutely serious about calling it an "operating system" at all). next, look in the directory l (this letter begins with the word linux, and finally find the desired directory: https://http.kali.org/kali/pool/main/l/linux/

There are a lot of things there, we are interested in packages that contain the word image in the name, secondly, the version you mentioned: 4.19.0-kali5-amd64, and thirdly, does not contain the word dbg in the name (these are packages with debugging information). fortunately, there are only two of them:

$ w3m -dump https://http.kali.org/kali/pool/main/l/linux/ | grep image | grep 4.19.0-kali5-amd64 | grep -v dbg
[ ]         kernel-image-4.19.0-kali5-amd64-di_4.19.37-6kali1_amd64.udeb            2019-07-22 5.4M  
[ ]         linux-image-4.19.0-kali5-amd64_4.19.37-6kali1_amd64.deb                 2019-07-22  45M

The main difference between these two packages is that the first of them is used only by theinstaller "udeb", it does not contain, for example, assembled modules. the second, insignificant difference (I'm getting ahead of myself) - the file with the program linux in the first of the packages has a short name vmlinuz, and in the second-a long vmlinuz-4.19.0-kali5-amd64 (again, looking ahead - the contents of these files are absolutely identical).

Download the smaller one (for the second package, the procedure is absolutely identical):

$ wget https://http.kali.org/kali/pool/main/l/linux/kernel-image-4.19.0-kali5-amd64-di_4.19.37-6kali1_amd64.udeb

And let's start extracting what we need. first, let's look at the content:

$ ar vt kernel-image-4.19.0-kali5-amd64-di_4.19.37-6kali1_amd64.udeb 
rw-r--r-- 0/0      4 Jul 22 12:27 2019 debian-binary
rw-r--r-- 0/0    504 Jul 22 12:27 2019 control.tar.xz
rw-r--r-- 0/0 5628080 Jul 22 12:27 2019 data.tar.xz

Yeah, it's obvious that you need to extract data.tar.xz - only this file has a sufficiently large size (5628080 bytes):

$ ar x kernel-image-4.19.0-kali5-amd64-di_4.19.37-6kali1_amd64.udeb data.tar.xz

Filter its contents for the string vmlinuz:

$ tar -tf data.tar.xz | grep vmlinuz
./boot/vmlinuz

There was such a letter in this word! we extract and move the file to where we need it, and under the name that we need:

$ tar -xf data.tar.xz ./boot/vmlinuz
$ sudo mv ./boot/vmlinuz /куда/примонтирован/раздел/boot/vmlinuz-4.19.0-kali5-amd64

That's it! thank you for reading up to this point.

 1
Author: aleksandr barakin, 2019-08-13 07:17:28

If you still have the installation CD / flash drive, boot from it and copy this file by hand. It should be on the disk!

If you do not have a disk/flash drive , the easiest way is to download it from the distribution site.

 0
Author: Sergey, 2019-08-13 01:50:52