Remove all python and kill linux

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Remove all python and kill linux

Post by frkhrd » Sat Nov 10, 2018 6:32 pm

hi I was getting some weird error and thought it was python so i uninstalled all things with python in the name. python 2 3 ....

well then linux just took a big bow and laughed at me. i could no longer install anything or do much i did a app update a upgrade i removed lost packages but it just got worse. I tried to reinstall any python but all failed with various errors but none of the suggested fixes worked.

the new restore was gone so i could not run it.. so i did a sudo install of it and that failed. but for some reason a command line version would start running after that and wanted the restore files but with 20 drives in the system it only listed like 6 so i could not see the drive with the files and i only knew the volume label of the drive and the #$@%@$^@^^ weird numbers it gaves of the drives were no use.

so i shut down most of the drive and am trying to find the drive with the backup on it now.


What I am trying to say you need to fix the distro so people can reinstall python if they accidently remove it !!!!

gm10
Level 12
Level 12
Posts: 4092
Joined: Thu Jun 21, 2018 5:11 pm

Re: Remove all python and kill linux

Post by gm10 » Sat Nov 10, 2018 7:00 pm

frkhrd wrote:
Sat Nov 10, 2018 6:32 pm
What I am trying to say you need to fix the distro so people can reinstall python if they accidently remove it !!!!
Had you tried to remove python via Software Manager it would not have let you, but if you insist on finding ways around that then nobody can stop you, this is Linux after all, you've got all the options.

Besides, everything that can be broken can be fixed again.

User avatar
richyrich
Level 19
Level 19
Posts: 9027
Joined: Mon May 04, 2009 8:31 pm

Re: Remove all python and kill linux

Post by richyrich » Sat Nov 10, 2018 7:48 pm

Please remember . .
Most every Linux Mint application is programmed in Python. Many other applications in Linux are either programmed in or require Python as a dependency. (including system apps)

User avatar
Moem
Level 17
Level 17
Posts: 7010
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Remove all python and kill linux

Post by Moem » Sat Nov 10, 2018 8:06 pm

frkhrd wrote:
Sat Nov 10, 2018 6:32 pm
What I am trying to say you need to fix the distro so people can reinstall python if they accidently remove it !!!!
You did not remove it accidentally. You did it on purpose, because you did not realise how much depends on it. That's on you.
Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on? :wink:
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

ajgringo619
Level 4
Level 4
Posts: 470
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California

Re: Remove all python and kill linux

Post by ajgringo619 » Sat Nov 10, 2018 8:27 pm

Moem wrote:
Sat Nov 10, 2018 8:06 pm
frkhrd wrote:
Sat Nov 10, 2018 6:32 pm
What I am trying to say you need to fix the distro so people can reinstall python if they accidently remove it !!!!
You did not remove it accidentally. You did it on purpose, because you did not realise how much depends on it. That's on you.
Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on? :wink:
If only Wile E. Coyote had known...
[Mint 19 XFCE, AMD FX-8350 Eight-Core w/16 GB RAM, 4.15.0-38-generic, GeForce GTX 960 w/Nvidia 410.73]
Image

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sat Nov 10, 2018 8:37 pm

This happened because like most linux users we dont know linux and beyond the gui its all smoke and mirrors. I use mint linux as it is the best linux out there for me coming from a dos/windows background. I did grow up with dos and windows 95 and got used to batch files and working command line but linux took me a while to get used to. I was in the process of updating nvidia drivers to the latest version so I could do some video work and I had to install and compile some things to get handbrake to the latest development version. somewhere in doing all this i got a python error and used that other installer mint has to remove python. I should have known better.
I had this linux running for many years since like mint version 12 and just keep upgrading it. This is the first real problem I have had.

Currently it only boots up in text mode I can still run apt-get install stuff but i get errors trying to install anything.

the common error seems to be
Consider setting $PYTHONEHOME to <prefix>[:<exec_prefix>]
/usr/bin/python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [Errno 2] no such file or directory.

the python directory got wiped i think when i did a remove abandoned packages.

I think i can get it running again if i can get past this python error. I did edit some file and put in a a path for pythonhome but that did not help.

I just wanted the developers to be aware this can happen and see if they can put in a work around for future releases.

At least the command line linux is still running so i can copy my data off to another machine.

redlined
Level 3
Level 3
Posts: 107
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State (Denver, CO:)

Re: Remove all python and kill linux

Post by redlined » Sat Nov 10, 2018 8:41 pm

Moem wrote:
Sat Nov 10, 2018 8:06 pm
frkhrd wrote:
Sat Nov 10, 2018 6:32 pm
What I am trying to say you need to fix the distro so people can reinstall python if they accidently remove it !!!!
You did not remove it accidentally. You did it on purpose, because you did not realise how much depends on it. That's on you.

Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on? :wink:
Moem, with your consent I think I'd like to use this bolded part, and call it "Moem kōan 42" (arbitrary number after reading dozens of such friendly intended quotables from you) 8)

edit to add: OP please do not find insult in my response here, I feel your pain in this fiasco created and do hope you find better options than to reinstall (if it can be done then the fine Linux minds in this forum will help resolve it). I learned something here,so I appreciate for sure and not at any cost to your well being. Good luck, friend!
Moem kōan 42: Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on?

(The answer to the ultimate question of life, the universe and everything is... 42!!;)

ajgringo619
Level 4
Level 4
Posts: 470
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California

Re: Remove all python and kill linux

Post by ajgringo619 » Sat Nov 10, 2018 8:48 pm

I'm glad you're going to be able to save your data. However, I don't see this as a developer issue, although I agree that some safeguards are necessary. UNIX/Linux give users the ability to do anything to their system, include completely hosing it (sudo rm -rf /, anyone? :D ). Maybe there's a bug in the removal script of one or more of the packages you removed; won't be the first or last time, unfortunately.
[Mint 19 XFCE, AMD FX-8350 Eight-Core w/16 GB RAM, 4.15.0-38-generic, GeForce GTX 960 w/Nvidia 410.73]
Image

User avatar
karlchen
Level 19
Level 19
Posts: 9412
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Remove all python and kill linux

Post by karlchen » Sat Nov 10, 2018 9:04 pm

Hello, frkhrd.

Provided you only used Synaptic or apt-get, i.e. the software management tools, to uninstall Python, in this case you can identfy the name of each software package, which has been removed, from the files
+ /var/log/term.log
+ /var/log/history.log
+ /var/log/dpkg.log

You should compile a complete list of all software packages, which have been removed. Best will be to write down the list on paper.

You could then use e.g. a Linux Mint live system and download each of the corresponding software packages (.deb files) from the official software repositories. - Therefore the optimal live system would be a live system, which has got the same Linux Mint release as your partially destroyed system.
Save all the downloaded .deb packages to a folder which will be accessible to your partially destroyed system.

Once you have downloaded all needed .deb packages and made them available on your partially destroy system, boot this system.
In the console, navigate to the directory holding all the downloaded software packages.
Use sudo dpkg -i <packagename> to install each and every downloaded package.
Be assured that this will be a tedious task.

Good luck,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

redlined
Level 3
Level 3
Posts: 107
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State (Denver, CO:)

Re: Remove all python and kill linux

Post by redlined » Sat Nov 10, 2018 9:06 pm

ajgringo619 wrote:
Sat Nov 10, 2018 8:48 pm
(sudo rm -rf /, anyone? :D ).
tempting! (and I see no <evil grin> to warn me away :D
ajgringo619 wrote:
Sat Nov 10, 2018 8:48 pm
Maybe there's a bug in the removal script of one or more of the packages you removed; won't be the first or last time, unfortunately.
because of this:
frkhrd wrote:
Sat Nov 10, 2018 6:32 pm
hi I was getting some weird error and thought it was python so i uninstalled all things with python in the name. python 2 3 ....
is there any hope for recovery thru console? (bolded text for emphasis) :(

edit to add- karlchen is on it!
Moem kōan 42: Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on?

(The answer to the ultimate question of life, the universe and everything is... 42!!;)

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sat Nov 10, 2018 9:50 pm

I have little hope of recovering this.
I was in the process of trying to decide to change to a server type os to try to lower the power needed to run this. Its a nas drive box with intel quad core 2 and a workstation type motherboard with dual ethernet. I like using mint as it was easier for me to do the shares and such but the video cards and desktop guy seem to keep the box powered up to much. I am considering openmediavault I think it would use less power and hot heat the room up so much. I wanted to use a 1050 video card to reincode my videos to x265 but after all my updating I found out nvenc will make x265 but the file size is many times larger than x264 as they are still working on the encoder source. So the only viable option at the current seems to be cpu encoding with newer intel cpus. I will give up on this its just cheaper to add more drives than buy a new machine.
I may try to use the dual Ethernet to connect a i7 machine for the encoding to the drive arrays. I really need to learn scripting so I can fix my messes.

User avatar
smurphos
Level 8
Level 8
Posts: 2007
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Remove all python and kill linux

Post by smurphos » Sat Nov 10, 2018 11:50 pm

If you've got a timeshift back-up from before your adventure, boot into live session from a 18.3 or 19 iso, and restore from there.

https://github.com/teejee2008/timeshift ... -Snapshots

Way less tedious. By the way this is the safeguard the development team have seen fit to provide for such disaster recovery (self inflicted or not).

The system has other safeguards in place - you will have clicked through or answered yes to a prominent warning of extensive package removal which should have given you a clue this was a bad idea.

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 2:28 am

I installed mint 18/64 on another pc to see if I can duplicate this. With the basic install and no updates, when I try to use synaptic package manager to remove all python its search of installed python and it will not filter only python. They much have updated that in a patch.
I am now downloading the patches to see if I can get synaptic package manager filter python and remove it the same way as it occurred before. Then test if the same error will occur after removing the python from a fresh install.

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 2:33 am

smurphos wrote:
Sat Nov 10, 2018 11:50 pm
If you've got a timeshift back-up from before your adventure, boot into live session from a 18.3 or 19 iso, and restore from there.

https://github.com/teejee2008/timeshift ... -Snapshots

Way less tedious. By the way this is the safeguard the development team have seen fit to provide for such disaster recovery (self inflicted or not).

The system has other safeguards in place - you will have clicked through or answered yes to a prominent warning of extensive package removal which should have given you a clue this was a bad idea.
Well its a deep hole I have dug. I did have time shift backup just before i converted file systems from mdffs to mergerfs and i renamed the volumes of all my drives. some were the temp drive with the backups got misplaced. I think there is 1 backup on the main drive after the changes. I am clearing off some extra drives to make a copy of this drive before i attempt to do much more to it.

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 3:00 am

frkhrd wrote:
Sun Nov 11, 2018 2:28 am
I installed mint 18/64 on another pc to see if I can duplicate this. With the basic install and no updates, when I try to use synaptic package manager to remove all python its search of installed python and it will not filter only python. They much have updated that in a patch.
I am now downloading the patches to see if I can get synaptic package manager filter python and remove it the same way as it occurred before. Then test if the same error will occur after removing the python from a fresh install.

I finished all the updated and noticed there was a filter and a search the filter will allow you to select all the installed linux.

After selecting them not all were selected and i had to also check the removable to get them all. then i click apply a box apears and says

essential to be removed
to be removed

i did a expand on essential to be removed and it listed mintsources as the essential I had removed that when the system crashed.

Im not sure why it was selected it did not have python in its name.

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 3:09 am

it seem mintsources uses python2 from reading this thread https://bugs.launchpad.net/linuxmint/+bug/1656581

i found this thread on installing mint sources i may try next http://elderbrendabradley.com/2018/01/3 ... ources-11/ this does not work on mint.

i tried sudo apt-get install mintsources and got that error python2.7 is bad again. so this will not work till python is fixed. it seems lots run int this python on 2.7 problem.
Last edited by frkhrd on Sun Nov 11, 2018 3:22 am, edited 1 time in total.

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 3:12 am

There is one other thing weird when linux boots it is to a blank screen i have to press windows key and exc or f1 to get the login prompt

User avatar
smurphos
Level 8
Level 8
Posts: 2007
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Remove all python and kill linux

Post by smurphos » Sun Nov 11, 2018 3:28 am

A big chunk of the operating system is based on python. You can't remove it without destroying your installation. Any package that relies on python will have it as a dependency and will be removed at the same time you remove python. Don't go there.

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 4:18 am

going to try to recompile python
cd /usr/src
sudo wget https://www.python.org/ftp/python/2.7.1 ... 2.7.14.tgz
Now extract the downloaded package.

sudo tar xzf Python-2.7.14.tgz
Step 3 – Compile Python Source

cd Python-2.7.14
sudo ./configure --enable-optimizations
sudo make ------------ I did not use altinstall since so it would try replace the default python.

this seemed to put python on. but i still get the consider setting python home

frkhrd
Level 1
Level 1
Posts: 11
Joined: Sat Nov 10, 2018 6:22 pm

Re: Remove all python and kill linux

Post by frkhrd » Sun Nov 11, 2018 4:32 am

it seems to want a minimal python and i dont see how to get it to work. Im trying that timeshift restore now.
I was surprised how easy it was to start the restore from command line.

I hope i dont have to hunt down the missing drive that had the other timeshift backups.

Post Reply

Return to “Newbie Questions”