Reinstalled Python3 wrong, system now "fails to start session" upon user login [Solved]
Reinstalled Python3 wrong, system now "fails to start session" upon user login
Events: I wanted to install a complex thing (thing in question is completely irrelevant) that needed another thing (also irrelevant) that used a python3 script as an installer. Python3 is not in $PATH by default, so I assumed that I didn't have it installed. Check MX Package Manager, says it's installed, assume it's a broken installation. I'm by this point used to uninstalling before reinstalling to hopefully clear any faulty dependencies along with the program, since that had caused issues in the past. I click uninstall, mash enter to get on with it already, as I had been in tutorial hell for hours, assuming nothing were to happen, and then watch it remove more packages than I thought it should, but think nothing of it. I reinstall (which was much faster) and promptly close the package manager and continue doing other things on my system. I slowly start to notice a bunch of things are kind of broken, and restart, hoping that would fix everything. Big mistake. It now boots to the normal graphical login screen, but does not pre-enter my username like normal, and more importantly, when I attempt to login it simply states in a small, temporary error bubble: "Failed to start session".
I fully realize that this is my fault. I should have read carefully, I should have done the safer reinstall process, I should have learned how to use the snapshot system, and how to backup the system more generally... but what matters right now is recovery. I simply want to know if: 1. there is a way to install packages onto or otherwise repair that system without logging into it normally (such as with a install/live disc, of which I have many, or through some sort of CLI commands accessed via GRUB boot options), 2. ideally a list of all preinstalled packages that require python3, or failing that 3. a way to find/create such a list for myself.
For very obvious reasons, I'd prefer a quick recovery process to a lengthy full reinstall, if possible. Thanks.
I fully realize that this is my fault. I should have read carefully, I should have done the safer reinstall process, I should have learned how to use the snapshot system, and how to backup the system more generally... but what matters right now is recovery. I simply want to know if: 1. there is a way to install packages onto or otherwise repair that system without logging into it normally (such as with a install/live disc, of which I have many, or through some sort of CLI commands accessed via GRUB boot options), 2. ideally a list of all preinstalled packages that require python3, or failing that 3. a way to find/create such a list for myself.
For very obvious reasons, I'd prefer a quick recovery process to a lengthy full reinstall, if possible. Thanks.
- Eadwine Rose
- Administrator
- Posts: 15174
- Joined: Wed Jul 12, 2006 2:10 am
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Please post your Quick System Info using Copy for forum, thanks.
MX-23.6_x64 July 31 2023 * 6.1.0-38amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login [Solved]
Boot with live usb (it can be also your snapshot iso (no matter old/new) , or also antiX other than the official MX iso).. whatever, then "Chroot Rescue Scan" from menu.Nimta wrote: Sat Mar 18, 2023 1:29 am... such as with a install/live disc, of which I have many, or through some sort of CLI commands...
It'll find your installed MX, press Enter, proceed ... then when you see the prompt
chroot>
you can issue:
Code: Select all
apt-history
As you might already know, in case manual operation needed: you can directly (i.e.) apt update ; apt install xyz ... apt reinstall xyz ... etc.. (and no need to sudo)
also you can issue
Code: Select all
mx-packageinstaller
_____________________
Tip: You can also use the tab key to auto-complete when tying them, say apt-h(press the tab), mx-pac(tab)...
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
It would have provided zero useful information and merely served to clog up and confuse the original post in this particular situation; no level of hardware or software differences would have changed what happened, nor the solution required, as I will soon describe.Eadwine Rose wrote: Sat Mar 18, 2023 4:11 am Please post your Quick System Info using Copy for forum, thanks.
I was unable to get apt-history to work, but learning that it was kept in more detail than just bash command history helped me to find the /var/log/apt/history.log file with a couple quick internet searches, and use that information to reinstall everything that had been removed using the live-demo method described. Thank you, this is exactly what I asked for and what I needed!Huckleberry Finn wrote: Sat Mar 18, 2023 5:22 am Boot with live usb [or] snapshot iso (no matter old/new)... whatever, then "Chroot Rescue Scan" from menu.
It'll find your installed MX, press Enter, proceed ... then when you see the prompt...
As for what exactly removing python3 did to my system in the first place; it took with it parts of thunar and apt, several drivers ranging from networking to graphics, the system clock, most of the MX app suite, and most importantly of all: light display manager and xfce in nearly their entireties. Let this be a lesson to all not to underestimate the impact of single packages, especially ones representing major langs like python.
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Glad to hear you managed to recover it and thank you for marking the thread :)
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Python is an absolutely essential part of the whole system. I haven't ever tried to remove it, but did you get any warnings from the system when you first essayed to uninstall it?
MXPI = MX Package Installer
QSI = Quick System Info from menu
The MX Test repository is mostly backports; not the same as Debian testing
QSI = Quick System Info from menu
The MX Test repository is mostly backports; not the same as Debian testing
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
None whatsoever, other than the simple size of the list of removed packages. MX Package Manager didn't ask any questions other than the standard yes biased "is this what you want to do" that it always does, which is why mashing enter worked in the first place. Ideally packages like this one should be softly protected from outright removal as I attempted here.Stevo wrote: Sat Mar 18, 2023 3:32 pm Python is an absolutely essential part of the whole system. I haven't ever tried to remove it, but did you get any warnings from the system when you first essayed to uninstall it?
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
On this opportunity: I had a humble suggestion to MX Team: Another tool (maybe a simple script) to roughly recover:
do just the opposite of whatever was done last time (considering the last date):
xyz was removed .. install
qqq was installed ... purge
Maybe someday ...
Meanwhile, I wish you told us apt-history was not working, this would manually do it:
do just the opposite of whatever was done last time (considering the last date):
xyz was removed .. install
qqq was installed ... purge
Maybe someday ...
Meanwhile, I wish you told us apt-history was not working, this would manually do it:
Code: Select all
zgrep -EH ' install | upgrade | purge | remove ' /var/log/dpkg* | cut -f2- -d: | sort -r | sed 's/ remove / remove /;s/ purge / purge /' | less
-
- Posts: 30
- Joined: Sat Jul 25, 2020 9:11 pm
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
This happened to me today - thanks for writing up what you encountered and how you fixed it!
I installed wine-staging, and for whatever fine reason it decided to remove the 64-bit python3 and install the i386 version. (I'd call that a packaging bug, honestly...) That in turn, of course, tagged every package that depended on python3 for removal - they didn't get removed until I (not realizing what the cause was) removed the unused drivers for Nvidia - that process somehow triggered the autoremove, and only by your writeup did I think to go find the apt log (never, never, never would have figured this one out.) Many calls to apt-get later, all back in order.
Again, many many thanks!
I installed wine-staging, and for whatever fine reason it decided to remove the 64-bit python3 and install the i386 version. (I'd call that a packaging bug, honestly...) That in turn, of course, tagged every package that depended on python3 for removal - they didn't get removed until I (not realizing what the cause was) removed the unused drivers for Nvidia - that process somehow triggered the autoremove, and only by your writeup did I think to go find the apt log (never, never, never would have figured this one out.) Many calls to apt-get later, all back in order.
Again, many many thanks!