0

I have purged python3.5 and its dependencies on Ubuntu 16.04, wanting to use 3.7 instead. Now, upon logging in, I have no access to anything, not even a terminal. How can I fix this?

JF0001
  • 111
  • 3
    You haven't provided your OS & release details, but python is rather critical for many Ubuntu tools (including a gnome-terminal), so I'd login to a text terminal and reverse whatever you did. You'll find many auto tools (apt, apt-get) may not work until python3 is restored to normal, but dpkg and like core tools will still work so it'll be more manual. Reversing your changes is easiest, be it restore a backup, or using history & apt logs, but as we don't know what you did, you'll have the best clue. – guiverc Dec 10 '20 at 23:28
  • Thank you guiverc. But how can I even log into terminal? This machine dual boots, Linux and Windows. Upon launching the computer, I can only select Linux or Windows. And once logged into Ubuntu, I have access to absolutely nothing. I am on Version 16.04. – JF0001 Dec 10 '20 at 23:31
  • 1
    Key is you need python -V; python3 -V to report correct values for your release. Once you've python3-minimal installed again (as long as it's not interfered with by any changes you made), the rest will be easy. Text terminals are not impacted by python changes (unless you've added python specific commands in login scripts). – guiverc Dec 10 '20 at 23:31
  • I have only executed the following: sudo apt-get autoremove --purge python3.5 And now I cannot access anything. – JF0001 Dec 10 '20 at 23:35
  • 1
    Login to a text terminal (ctrl+alt+F4) and restore python, or at minimum python3-minimal (minimum subset required). You'll have to avoid any tools that need python (ie. GUI, apt & like front-end user tools) & stick to basic tools (text terminal, dpkg etc are coded in C, user-geared tools are often python). Download using wget & use dpkg -i to install given you removed access to apt-get being usable I bet.. – guiverc Dec 10 '20 at 23:38
  • Thank you again guiverc. Is there a way to reverse the exact command that I have executed: sudo apt-get autoremove --purge python3.5 – JF0001 Dec 10 '20 at 23:40
  • 1
    Normally apt-get purge would be reversed by apt-get install, however you need to fix the python issue before apt-get will work... thus using the lower-level tools; apt-get is a front-end for, ie. wget & dpkg as I've already said.. the python3-minimal is the core package you'll need to get re-installed, then you'll find you can use higher-level tools like apt-get again making it easier – guiverc Dec 10 '20 at 23:42
  • Thank you for your time and help guiverc. – JF0001 Dec 10 '20 at 23:46
  • Thank you again a million times guiverc. I was able to recover my installation. – JF0001 Dec 11 '20 at 02:59

0 Answers0