Page 1 of 1
Reinstalled Python3 wrong, system now "fails to start session" upon user login
Posted: Sat Mar 18, 2023 1:29 am
by Nimta
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.
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Posted: Sat Mar 18, 2023 4:11 am
by Eadwine Rose
Please post your
Quick System Info using Copy for forum, thanks.
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login [Solved]
Posted: Sat Mar 18, 2023 5:22 am
by Huckleberry Finn
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...
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.
It'll find your installed MX, press Enter, proceed ... then when you see the prompt
chroot>
you can issue:
to see / save in a text file etc. what were removed , installed etc...
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
and use the gui.
_____________________
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
Posted: Sat Mar 18, 2023 7:42 am
by Nimta
Eadwine Rose wrote: Sat Mar 18, 2023 4:11 am
Please post your Quick System Info using Copy for forum, thanks.
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.
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...
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!
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
Posted: Sat Mar 18, 2023 8:54 am
by Huckleberry Finn
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
Posted: Sat Mar 18, 2023 3:14 pm
by baldyeti
Nimta wrote:
I was unable to get apt-history to work,
I don't know if it has been advertised but i only noticed recently that the graphical version of "Quick System Info" has grown a log viewer function, which amongst other things can show the most recent apt activity. Real handy.
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Posted: Sat Mar 18, 2023 3:32 pm
by Stevo
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
Posted: Sat Mar 18, 2023 4:14 pm
by Nimta
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?
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.
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Posted: Sat Mar 18, 2023 4:46 pm
by Huckleberry Finn
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:
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
Re: Reinstalled Python3 wrong, system now "fails to start session" upon user login
Posted: Wed Jan 03, 2024 7:35 pm
by PhilSalkie
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!