Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

portage broke, how do I repair?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

portage broke, how do I repair?

  • Quote

Post by nellson » Mon Mar 16, 2015 3:38 am

Have 4 identical systems running Gentoo. Using one to learn Python on and when I logged into today.. python was coughing errors on class programs that were working yesterday.. started the python interpreter and could not even "import paramiko"

Though maybe it was paramiko at fault, so I tried to emerge --search paramiko to see if I could update it.. Emerge is broken.

Code: Select all

bertha portage-2.2.18 # emerge --sync
  File "/usr/lib/python-exec/python2.7/emerge", line 23
    from __future__ import print_function
       ^
SyntaxError: invalid syntax
Doing searching on this and it seems this is some pre-code to help between Python 2.x and 3.x? I am set to 3.4 in eselect, have been for a long while. Portage was happy using the still-installed 2.7.

bertha portage-2.2.18 # eselect python list
Available Python interpreters:
[1] python2.7 *
[2] python3.2
[3] python3.3
[4] python3.4

I even tried going back to 2.7 for all.. no help.

So, as I do have 4 identical hardware systems running Gentoo, and the other 3 seem fine, I am guessing my Python Class helped me do something bad? How do I fix portage? The whole binary package directions seem to still require a working portage on the receiving end. :-)
Top
dol-sen
Retired Dev
Retired Dev
User avatar
Posts: 2805
Joined: Sun Jun 30, 2002 2:44 pm
Location: Richmond, BC, Canada

  • Quote

Post by dol-sen » Mon Mar 16, 2015 5:51 am

Please post the file contents so we can see what is wrong with it. It should be a very small file, only 86 lines in it's original form. It will be the lines leading up to that error that are the most important.
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Top
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

  • Quote

Post by nellson » Mon Mar 16, 2015 12:13 pm

Here is the contents..

Code: Select all

bertha ~ # cat /usr/lib/python-exec/python2.7/emerge
#!/usr/bin/python2.7 -b
# Copyright 2006-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

from __future__ import print_function

import platform
import signal
import sys

# This block ensures that ^C interrupts are handled quietly. We handle
# KeyboardInterrupt instead of installing a SIGINT handler, since
# exiting from signal handlers intermittently causes python to ignore
# the SystemExit exception with a message like this:
# Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
try:

        def exithandler(signum, _frame):
                signal.signal(signal.SIGTERM, signal.SIG_I#!/usr/bin/python2.7 -b
# Copyright 2006-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

from __future__ import print_function

import platform
import signal
import sys

# This block ensures that ^C interrupts are handled quietly. We handle
# KeyboardInterrupt instead of installing a SIGINT handler, since
# exiting from signal handlers intermittently causes python to ignore
# the SystemExit exception with a message like this:
# Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
try:

        def exithandler(signum, _frame):
                signal.signal(signal.SIGTERM, signal.SIG_IGN)
                sys.exit(128 + signum)

        signal.signal(signal.SIGTERM, exithandler)
        # Prevent "[Errno 32] Broken pipe" exceptions when
        # writing to a pipe.
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)

        def debug_signal(_signum, _frame):
                import pdb
                pdb.set_trace()

        if platform.python_implementation() == 'Jython':
                debug_signum = signal.SIGUSR2 # bug #424259
        else:
                debug_signum = signal.SIGUSR1

        signal.signal(debug_signum, debug_signal)

        from os import path as osp
        if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
                sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
        import portage
        portage._internal_caller = True
        portage._disable_legacy_globals()
        from _emerge.main import emerge_main

        if __name__ == "__main__":
                from portage.exception import IsADirectory, ParseError, \
                                PermissionDenied
                try:
                        retval = emerge_main()
                except PermissionDenied as e:
                        sys.stderr.write("Permission denied: '%s'\n" % str(e))
                        sys.exit(e.errno)
                except IsADirectory as e:
                        sys.stderr.write("'%s' is a directory, but should be a file!\n"
                                        "See portage man page for information on "
                                        "which files may be directories.\n" %
                                        str(e))
                        sys.exit(e.errno)
                except ParseError as e:
                        sys.stderr.write("%s\n" % str(e))
                        sys.exit(1)
                ebertha ~ # 
Top
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

  • Quote

Post by nellson » Mon Mar 16, 2015 12:20 pm

WTH?? some strange double code at the top, my other systems do not have that... OK, I am only learning for loops in my class, no way I whacked up my system this badly.. :-O

And I did not do any system updates or world updates between Sat and Sunday..

The system does an "emerge --sync" once a night, but that shouldn't hork anything up, would it?

Nick
Top
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

  • Quote

Post by nellson » Mon Mar 16, 2015 2:47 pm

OK.. <sigh> system #2 can't create any packages, fails compiling.. on anything... Something has shaken the Gentoo tree while I wasn't updating every day and I seem to have dropped behind some curve that is proving a bit of a challenge to get passed..

How might I get python and portage re-imaged to a working state so I can start repairing the rest?

Nick
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Mon Mar 16, 2015 2:59 pm

http://forums.gentoo.org/viewtopic-p-77 ... ml#7707196

That's not the only way, but clearly the easiest one for everyone and any package.
Top
dol-sen
Retired Dev
Retired Dev
User avatar
Posts: 2805
Joined: Sun Jun 30, 2002 2:44 pm
Location: Richmond, BC, Canada

  • Quote

Post by dol-sen » Mon Mar 16, 2015 3:29 pm

Might I suggest you check for bad memory and fsck your hard drive for any file corruption before you proceed any further.
while your at it, have you checked/cleaned the cpu fan & heatsink? Maybe some excess heat caused your cpu to do something strange.
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Top
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

  • Quote

Post by nellson » Mon Mar 16, 2015 5:41 pm

I may have to do that. This system has no other boot media, I loaded it up using PXE Boot with sysrescueCD. I can do that again to use the memory and fsck tools, and sounds like that is how I am going to repair it anyway.

The systems are in a controlled data center (Re purposed Silver Peak WAN OPT head ends) for my own lab. Should be fairly dust free, but I will insure that.

Nick
Top
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

  • Quote

Post by nellson » Mon Mar 16, 2015 9:56 pm

So perhaps I was mistaken on the other 3 systems.. I have just one system that appears portage functional, three that are failing any form of portage command with python errors.

one seems to be somewhat happy...

Made a quickpkg and untar'ed it over the / dir, and recreated the /usr/bin/emerge symlink.. got a successfull "emerge --sync" out of it!!

Rebuilding portage again properly.. Here's hoping I can get this all repaired :-D
Top
nellson
n00b
n00b
Posts: 66
Joined: Thu Jun 24, 2004 3:49 pm

  • Quote

Post by nellson » Tue Mar 17, 2015 8:22 pm

OK, got things sorted out... on Sunday around 1 pm our computer room annex took a power hit and dropped all 4 of my systems. (Never thought to check "uptime" duh....

So that scrambled them good. system #3 was recoverable enough with a fresh tar of portage and "emerge -e system --keep-going" took around 5 washes through to get no errors.

Then I built binaries of gcc, bash, glibc, portage, and python2.7, and ssh'ed them to the other 3.

Split to tbz2 files out into the raw tar (emerge was totally non-functional on all 3) and untarred all 4 builds over the top of my / directory.

Fixed a missing symlink to /usr/lib/portage-exec/portage-exec2 and started in on the "emerge -e system --keep-going" and getting down to where I am almost through all 4 systems cleanly..

These systems use 4 160gig flash SAS drives as /dev/md0 for /, and I am thinking hard dropping power was.. erm.. bad? ;-)

Once they are all rebuilt for system, I'll go for the "-uDavN" on 'world' and get them back up to snuff. Then I will lobby to get my toys moved out of the lab annex and onto house UPS :-D

Thanks all, hope this helps others with disaster.. though I did need at least one system of the set of 4 that had some of it's marbles intact.

Nick
Top
Post Reply

10 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic