Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Removed accidentally python-exec, cannot emerge anymore
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
10B2
n00b
n00b


Joined: 28 May 2013
Posts: 65

PostPosted: Thu Aug 16, 2018 6:59 am    Post subject: Removed accidentally python-exec, cannot emerge anymore Reply with quote

During a system update, to resolve a block accidentally removed python-exec. When trying to emerge the python command is bad interpreted (maybe the python wrapper gone as well). Any general idea how to tackle this problem?

Cheers
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Thu Aug 16, 2018 7:05 am    Post subject: Reply with quote

Not necessarily an immediate answer for resolving, which I think would probably best be done perhaps using some tools like wget or even git (if installed) to find a working binary or source of that package online and then install it into somewhere (like a temporary folder) which you can then add to PATH in the environment in order to call that. But I think there is even a better way online to retrieve a "fixed" or working portage if what you now have is really messed up. But really, how do you accidentally remove something in your description? That doesn't seem easy to do. 8O :?:

What file is it that is missing, and what architecture are you on? The more typical solution to such a problem is going to make use of some live media to repair the system, and it could involve some trickiness with the likes of chroots or at least mounting and copying working files over to the folders. Not a pretty solution. I will hopefully like to know if there is some way to download a snapshot of just portage, including the major dependencies like compiler, toolkit, and some programming language files for python (since the WHOLE THING IS WRITTEN IN IT)


Last edited by LIsLinuxIsSogood on Thu Aug 16, 2018 7:10 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30914
Location: here

PostPosted: Thu Aug 16, 2018 7:06 am    Post subject: Reply with quote

You tried with
Code:
$ /usr/lib/python-exec/python2.7/emerge  -1 python-exec

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Thu Aug 16, 2018 7:07 am    Post subject: Reply with quote

You could symlink python36 to python and disable sandbox and remerge

You could alias python to pytgob36
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
Maitreya
Guru
Guru


Joined: 11 Jan 2006
Posts: 441

PostPosted: Thu Aug 16, 2018 9:11 am    Post subject: Reply with quote

And this maybe sound a bit "captain hindsight!", but in the future you might want to add "buildpkg" to FEATURES.
This way you can usually just unpack onto root system until portage/emerge works again.
(I know it saved me many times)
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Thu Aug 16, 2018 9:24 am    Post subject: Reply with quote

(I editted my response for clarity as I do sometimes)

captain Hindsight,
Meanwhile do you know is there a repository out there with working builds for these possibly devastating situations of suddenly deleting or missing an important system package???

I would hope that there would be with all the work done to maintain installations for multiple architectures? Otherwise all those pre-built packages on those CD's are sort of going to waste if they aren't made available for download somewhere else on an as needed basis for this kind of situation...assuming that the other suggestions haven't worked to resolve the iissue for OP.

Maybe if one doesn't already exist then there should be a list of the packages from the adminCD or installation CD that are available individually for download maybe, like a downloads.gentoo.org?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Thu Aug 16, 2018 9:51 am    Post subject: Reply with quote

LIsLinuxIsSogood,

There are several BINHOSTS. I usually only post a link when when is needed.

Fix My Gentoo always works.
In effect, you build your own BINHOST, as much as you need, with your settings, when you need it.

Maitreyas idea means you have a matching BINHOST to hand before you need it though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Thu Aug 16, 2018 10:12 am    Post subject: Reply with quote

With a nod to Neddy
Quote:
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.


I've gotten pretty religious about backups, nightly onto a mirrored raid, 4 week rolling backup on Sun,
and an occasional backup to another two disks only plugged in for the backup.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Fri Aug 17, 2018 12:35 am    Post subject: Reply with quote

I fully agree that backup is the best solution albeit a preventative one.

But out of curiosity I went to google and did a search for binhost repository for gentoo, and this link came up...looks like python package as well as pretty much most other packages that you could need for the system (to stabilize it in crisis mode) is in there.

what is the guess about how one of these packages could work as a replacement, of course knowing that the point is not to rebuild yet, but just fix the broken system at which point in time reinstalling is always an options (for better USE Flags and CFLAGS)

http://packages.gentooexperimental.org/packages/

If nobody has an immediate answer here then what I will likely experiment with later is purposefully breaking Portage :wink: to see what happens if I have to replace it with this pre-built version of it from the download site.

One other thing is kinda confusing which I assume this link does not have anything to do with the actual gentoo distribution so it could very well be malware or something crazy. That would of course be good to have a sense of that before installing :roll:
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Fri Aug 17, 2018 10:27 am    Post subject: Reply with quote

LIsLinuxIsSogood,

That's a Gentoo developers binhost but you are right to be wary. The Packages file at the top level of the tree tells how everything is built.
I'm fairly sure its generic, so if you use binaries from there, you need to rebuild whatever you install to suit your own setup.

If you configure binhosts in make.conf and use emerge -G portage will find a binary that fits or fail.
That assumes that emerge still works.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Sat Aug 18, 2018 8:26 am    Post subject: Reply with quote

Neddy thanks for clarifying about the safety of that site, but what is still a bit confusing in terms of an answer for the thread here, why does this option not rank higher in terms of other recommendations such as finding installation media and stuff like that. Is it because the OP has a broken portage already, and wouldn't retrieving the pre-built binary still work from the web even without using Portage, and without setting BINHOST and emerge -G...just checking if question that OP posed was either fixed or else still open to find a way to merge a critical system component that is missing?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sat Aug 18, 2018 8:48 am    Post subject: Reply with quote

LIsLinuxIsSogood,

Removing python-exec is a scary thing to do but not fatal to using emerge, so installing a binary is a bit over the top.
Its a little like --depcleaning your active gcc.

With a broken emerge, you need to treat each binary package as a mini stage3 and install it to / with tar.
You can't use emerge, its broken.
Installing with tar is a last ditch approach as there is no safety net. tar will spray files all over your system.

When python-exec is missing, fedeliallalineas
Code:
/usr/lib/python-exec/python2.7/emerge  -1 python-exec
will work and is by far the safest fix.
Actually, that has /python-exec/ in the command path, so I don't think that's quite right.
The concept is sound, which is to invoke emerge without using python-exec.

If that fails, more investigation is called for before using a BINHOST and tar.

There are many ways to get binary packages, from a stage3, from a BINHOST, from a friend, build your own ...
What matters is that you get one that matches your install well enough to be able to rebuild whatever you needed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Sat Aug 18, 2018 9:14 am    Post subject: Reply with quote

Or in other words if the package was found in binary form that it has to match just well enough to take the next step in the process.

I somewhat disagree though about the notion that it has to be functional enough to be building more than just one or two packages, since following this step it would probably make sense to just rebuild the package itself, if Portage and everything was working fine.

However I am not sure about the python-exec one, and whether or not some prebuilt package can or would fix the problem with emerge.

I do agree with the idea behind your approach which I would assume that these suggestions for taking things one step at a time with diagnosing issues is a proven way to handle many possible problems of varying complexity. But it is rather unfortunate when the question arises about something small like this that the best solution to fixing the broken system has to get traced back to the install cd. But it makes sense I guess. I just figured that it would be interesting to provide a different approach but I suppose that fixing without diagnosing the problem is a recipe for more problems to occur.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sat Aug 18, 2018 9:48 am    Post subject: Reply with quote

LIsLinuxIsSogood,

Lets take a worked example. Don't actually do this at home.

First an essential package.
Lets say you manage to remove glibc. Everything uses glibc. Nothing works, you can't even chroot into broken install because bash needs it.
In this case the correct course of action is to get a binary glibc for your arch of at least the version you were running.
Horrible things happen if you downgrade glibc.
You install the binary glibc with tar and all is well again. You run
Code:
emerge -1 glibc
get get your own glibc back.

Now a non essential package. xorg-server.
You can't run a GUI but your console still works. You
Code:
emerge -1 xorg-server
and make a note not to do that again.

Now python-exec. python-exec is a collection of wrapper scripts. Its not essential to executing emerge, as long as you don't just type emerge.
Read
Code:
/usr/lib/python-exec/python2.7/emerge
Its a python script.
emerge can be run without python-exec.

You can try this
Code:
/usr/bin/python2.7 /usr/bin/emerge --info

That runs emerge using python2.7. Other versions will work too.

A similar invocation to install python-exec should work too.
Since emerge can be made to work, use it to recover.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Sat Aug 18, 2018 10:31 am    Post subject: Reply with quote

Great to see this level of detail in the answer laying it out nicely! Totally awesome, just now we have to hear back from OP on this topic!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum