Solved My Kali Linux live system started to malfunction after apt full-upgrade

Solved issue

n0e

New Member
Joined
Oct 17, 2024
Messages
7
Reaction score
2
Credits
74
First of all, I'm a beginner. I know basics of Linux, and that's it.
Second of all, I have installed a live Kali Linux with encrypted persistence on USB. It was working for quite some time, until yesterday, after about 6 months of not using it all, I've decided to do apt update & apt full-upgrade. During the upgrade I guess that some graphic driver was installed that basically made it unusable. Everything on screen became scrambled. I couldn't do anything except reboot with ctrl-alt-del, during the shutdown the graphics went to normal, so it's surely some driver. The problem is I don't know how to fix it now. When I boot from USB, I have all the different options, except during booting to each of them I encounter this driver getting loaded and nothing becomes usable. I would like to either repair this, but for that I would need to boot into the system somehow, and I can't get text terminal to work, or at least recover data from the encrypted persistence. One of the options in the bootloader was Advanced-> rescue mode, but the end result was very similar:

unnamed (3).jpg



Any ideas how I can fix this?
 


First of all, I'm a beginner. I know basics of Linux, and that's it.
Well you are lucky to have mad it through 6 months without problems, did you not read the Kali docs before you decided to install it?
Looking at your screenshot, my best guess is graphics driver problems, to enable other members to help please advise as to the make and chipset [model] of your graphics card.
 
I mean, when I was installing it, I did. And it worked for quite some time well. The problem began after apt upgrade.

So my card is AMD Radeon Vega 8.

How do I access the system from terminal? I do not even need to restore the system, I can just create another one from image. My main point of concern right now is retrieving data from encrypted persistence.
 
Axe Kali, get Mint. If you want to to be elite, get Arch. Or if you want to really be cool, way cooler than the Linux boyz, get into FreeBSD (actually, it's quite a good OS. But there's way more development and support going on this side of town...)
Now time for me to offer you some actual advice for your immediate issue:
1. Is it full disk encryption? If yes, it may be a little more complicated (If it's just your home partition, you can boot live and mount it like any encrypted volume with relatively more ease).
2. Is the picture you posted from when your graphical shell (Desktop) starts? If yes, then you can Ctrl + Alt + F2 into another TTY. From there, uninstall your graphics drivers and reinstall them and copy your data.
3. Does the bootloader still boot? If so, just press e over you default boot, add nomodeset under your kernel parameters (at the end of the stuff in front of "linux") and press Ctrl + x. If it starts up fine, uninstall your current drivers and reinstall them and copy your data.

Before me posting any more, let us know about the above.

PS: @Brickwizard You took the words right out of my mouth as I read the OP I planned to post almost the exact same thing.
 
First of all, I'm a beginner. I know basics of Linux, and that's it.
Second of all, I have installed a live Kali Linux with encrypted persistence on USB. It was working for quite some time, until yesterday, after about 6 months of not using it all, I've decided to do apt update & apt full-upgrade. During the upgrade I guess that some graphic driver was installed that basically made it unusable. Everything on screen became scrambled. I couldn't do anything except reboot with ctrl-alt-del, during the shutdown the graphics went to normal, so it's surely some driver. The problem is I don't know how to fix it now. When I boot from USB, I have all the different options, except during booting to each of them I encounter this driver getting loaded and nothing becomes usable. I would like to either repair this, but for that I would need to boot into the system somehow, and I can't get text terminal to work, or at least recover data from the encrypted persistence. One of the options in the bootloader was Advanced-> rescue mode, but the end result was very similar:



Any ideas how I can fix this?
The upgrade process mentioned here is "apt update & apt full-upgrade". If that was the process implemented, then it was not the recommended way of upgrading, nor an optimal way of doing it.

Before running a full-upgrade directly after running update, the important step of upgrading the existing installation before the full-upgrade, has been missed. Installing the software in systems using the apt package manager works most effectively when each step is taken sequentially with no steps being omitted.

See here for a canonical description of the process: https://wiki.debian.org/DebianUpgrade
 
Last edited:
Axe Kali, get Mint. If you want to to be elite, get Arch. Or if you want to really be cool, way cooler than the Linux boyz, get into FreeBSD (actually, it's quite a good OS. But there's way more development and support going on this side of town...)
Now time for me to offer you some actual advice for your immediate issue:
1. Is it full disk encryption? If yes, it may be a little more complicated (If it's just your home partition, you can boot live and mount it like any encrypted volume with relatively more ease).
2. Is the picture you posted from when your graphical shell (Desktop) starts? If yes, then you can Ctrl + Alt + F2 into another TTY. From there, uninstall your graphics drivers and reinstall them and copy your data.
3. Does the bootloader still boot? If so, just press e over you default boot, add nomodeset under your kernel parameters (at the end of the stuff in front of "linux") and press Ctrl + x. If it starts up fine, uninstall your current drivers and reinstall them and copy your data.

Before me posting any more, let us know about the above.

PS: @Brickwizard You took the words right out of my mouth as I read the OP I planned to post almost the exact same thing.
The recommendation is good, I will drop Kali and just get Mint, once I've finished with recovering data.

1) it's not a full disk encryption. Only a single volume is encrypted and mounted during the boot process

2) ctrl+alt+f2 doesn't work. Not sure why

3) i an unable to this as well. Pressing e does nothing. Is it possible that this is because it is a live system and not one actually installed?

What I see after booting from my USB:

20241017_221718.jpg


Then it asks for password for encrypted persistence:

20241017_221837.jpg



Then it's loading...

20241017_222010.jpg


And then it's just this blinking over and over:

20241017_222044.jpg



What I've noticed is that when I press repeatedly ctrl+alt+f2 at some point I can see text terminal for a split of a second and then it disappears and this screen is again blinking.
 
Okay, good news is you can retrieve your data easily. Literaly any distro will have cryptsetup in their repos. So you're safe there.

Now if switching to a new TTY is blinking, it may be the X server reconnecting. I specifically chose TTY2 to avoid this as usually the X session runs from the TTY it was called from, typically 7 in systems with DMs and 1 on systems like mine. It's possible your DM is respawning per tty? TBH I'm not super clued up on DMs as I hate them and see them as counter-productive... So matbe another member can give input there.

To just salvage your data:
Boot live without persistence. Try the top option (I suspect "fail-safe" has no graphical session which may daunt you). Anyway, when you boot live you'll have generic drivers so you'll be in a desktop. Simply install cryptsetup (if not installed -- it should be):
apt-get update && apt-get install cryptsetup
Don't worry, so long as you're live, nothing you install is permanent. It's in ramfs.
Now we want to mount your encrypted partition (sda2):
cryptsetup luksOpen /dev/sda2 my_data
This will ask for your password. Enter it as usual. Next...
ls /dev/mapper
To check "my_data" is mapped. Now let's mount it:
mount /dev/mapper/my_data /mnt/
If all is good so far, you can copy all your data from /mnt to another flashdrive or external drive, whatever you prefer.
Finally, verify everything you copied. For the sake of doing things properly, lets unmount and close your encrypted volume:
umount /dev/mnt
cryptsetup luksClose my_data

Now you can move on to a more useable distro. Mint is welcoming for newcomers. Friendly community, too. If you want something portable and lightweight, there's AntiX Linux (Debian based) and they have a great community, too. I'd say install mint and setuo AntiX with persistence as with Kali. Find your niche and then stick with it.

Let me know if any complications come up and be sure to post the step by step of what happened.
 
Moved to Kali Linux

Off-topic:

LOL I thought about that myself. I noted it was in the hardware forum, which is generic enough and accurate enough. I couldn't figure out if the Kali sub-forum was the most appropriate so I just left it knowing you'd make the move if you thought it needed it.
 
Also, there's another one. It's a sorta Kali question in the hardware section.

I'm "off duty" and on my second glass of wine, so I'll leave the moderation to the professionals!
 
Okay, good news is you can retrieve your data easily. Literaly any distro will have cryptsetup in their repos. So you're safe there.

Now if switching to a new TTY is blinking, it may be the X server reconnecting. I specifically chose TTY2 to avoid this as usually the X session runs from the TTY it was called from, typically 7 in systems with DMs and 1 on systems like mine. It's possible your DM is respawning per tty? TBH I'm not super clued up on DMs as I hate them and see them as counter-productive... So matbe another member can give input there.

To just salvage your data:
Boot live without persistence. Try the top option (I suspect "fail-safe" has no graphical session which may daunt you). Anyway, when you boot live you'll have generic drivers so you'll be in a desktop. Simply install cryptsetup (if not installed -- it should be):
apt-get update && apt-get install cryptsetup
Don't worry, so long as you're live, nothing you install is permanent. It's in ramfs.
Now we want to mount your encrypted partition (sda2):
cryptsetup luksOpen /dev/sda2 my_data
This will ask for your password. Enter it as usual. Next...
ls /dev/mapper
To check "my_data" is mapped. Now let's mount it:
mount /dev/mapper/my_data /mnt/
If all is good so far, you can copy all your data from /mnt to another flashdrive or external drive, whatever you prefer.
Finally, verify everything you copied. For the sake of doing things properly, lets unmount and close your encrypted volume:
umount /dev/mnt
cryptsetup luksClose my_data

Now you can move on to a more useable distro. Mint is welcoming for newcomers. Friendly community, too. If you want something portable and lightweight, there's AntiX Linux (Debian based) and they have a great community, too. I'd say install mint and setuo AntiX with persistence as with Kali. Find your niche and then stick with it.

Let me know if any complications come up and be sure to post the step by step of what happened.

Thank you very much, I have it all back - except one thing. The PGP keyring from Kleopatra. Where it could be located? I cannot find an answer online. Obviously, I can't run Kleopatra to create a backup.
 
I'm not sure exactly but the ~/.gnupg/ directory comes to mind. They may be in a also in a subdirectory like ~/.gnupg/private-keys-[v-something].d/ . Hope that helps.
 
I'm not sure exactly but the ~/.gnupg/ directory comes to mind. They may be in a also in a subdirectory like ~/.gnupg/private-keys-[v-something].d/ . Hope that helps.
I've found that in the documentation. The only problem is that this is the folder in the installed system. I can't seem to find it in the persistence drive:
20241018_230548.jpg


I get permission denied when I try to enter /mnt/rw/root as well.
 
The reason you could not cd to root/ because you were not the root user, ie "root", and and the x (execute bit) is not set.

Sub to root: either su (enter root password) or sudo su (enter your password -- should work on improperly secured most OTB systems).

Option A:
su or sudo su
cd /mnt/rw/home/<username>
ls -al
Take a looksie...

Option B :
Or just take the shotgun approach and nuke it for full access:
su or sudo su
# Make everything readable and executable:
chmod -R a+rx /mnt/
# Optional, try to make writable (what can be writable) if needed.
chmod -R a+w /mnt/
# You can now access as a normal user.
cd /mnt/rw/home/<username>
ls -al
See what's there...

Note: The keys should be in the home/<username>/.gnupg/ typically, but if the system does weird things and runs you as root, it may be in root/.gnupg/ .
 
The reason you could not cd to root/ because you were not the root user, ie "root", and and the x (execute bit) is not set.

Sub to root: either su (enter root password) or sudo su (enter your password -- should work on improperly secured most OTB systems).

Option A:
su or sudo su
cd /mnt/rw/home/<username>
ls -al
Take a looksie...

Option B :
Or just take the shotgun approach and nuke it for full access:
su or sudo su
# Make everything readable and executable:
chmod -R a+rx /mnt/
# Optional, try to make writable (what can be writable) if needed.
chmod -R a+w /mnt/
# You can now access as a normal user.
cd /mnt/rw/home/<username>
ls -al
See what's there...

Note: The keys should be in the home/<username>/.gnupg/ typically, but if the system does weird things and runs you as root, it may be in root/.gnupg/ .

Thank you very much for your help, I was able to find the directory.

As it turned out, the root folder was empty. But when I navigated to /home/kali/.gnupg/ I found it all. Thank you for your assistance, I am moving onto Mint. I will probably do a full install on USB with encrypted volume instead of live system with encrypted persistence, seems easier to navigate when the issues arise.
 
Thank you very much for your help, I was able to find the directory.

As it turned out, the root folder was empty. But when I navigated to /home/kali/.gnupg/ I found it all. Thank you for your assistance, I am moving onto Mint. I will probably do a full install on USB with encrypted volume instead of live system with encrypted persistence, seems easier to navigate when the issues arise.

Glad I could help. Good luck with your new install!
 



Top