Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 369067 - emerge --depclean remove python-2.6.6-r1, and break emerge
Summary: emerge --depclean remove python-2.6.6-r1, and break emerge
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-28 18:02 UTC by Gilles Espinasse
Modified: 2011-06-01 08:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gilles Espinasse 2011-05-28 18:02:46 UTC
after having run emerge --sync && emerge --update --deep --newuse world , fixed the network interface configuration after reboot due to openrc changes, I run emerge --depclean

As python-2.7 and python-3.1 were already installed, I was not afraid about python-2.6.6 removal but I was wrong.

emerge was no more working after depclean

The reason should be that /usr/bin/python2 was still a symlink to python2.6 and python2.6 was uninstalled.

find /usr/{s,}bin -name "python*" -ls
652913   24 -rwxr-xr-x   1 root     root        23712 May  8 20:23 /usr/sbin/python-updater
767051    0 lrwxrwxrwx   1 root     root            9 May 28 13:30 /usr/bin/python2 -> python2.6
767107    0 lrwxrwxrwx   1 root     root           14 May  8 20:19 /usr/bin/python -> python-wrapper
767045    0 lrwxrwxrwx   1 root     root            9 May  8 20:19 /usr/bin/python3 -> python3.1
767363    4 -rwxr-xr-x   1 root     root          217 May  8 20:19 /usr/bin/python-config
511277    8 -rwxr-xr-x   1 root     root         5292 May  8 20:29 /usr/bin/python2.7
511326    4 -rwxr-xr-x   1 root     root         1400 May  8 20:28 /usr/bin/python-config-2.7
703073   12 -rwxr-xr-x   1 root     root         9388 Mar 28 12:56 /usr/bin/python-wrapper
214192   12 -rwxr-xr-x   1 root     root         9388 May  8 20:19 /usr/bin/python3.1
215256    4 -rwxr-xr-x   1 root     root         1177 May  8 20:19 /usr/bin/python-config-3.1
I made a few symlink try before finding the right fix, don't trust all symlink dates
I fixed that temporary using 
ln -sf python3.1 /usr/bin/python

After that, emerge was enought functional, so I could reinstall python2.6 and select again python2.6 as default


Reproducible: Couldn't Reproduce

Steps to Reproduce:
I was not able to reproduce.

I reinstalled python-2.6 with :
emerge dev-lang/python:2.6

and selected again python2.6 as default with :
eselect python set python2.6

I had a emerge --sync made, so maybe the issue was fixed between the 24 and the 28 may?
Then using 
Actual Results:  
emerge.log show
1306438488: Started emerge on: May 26, 2011 21:34:48
1306438488:  *** emerge  depclean
1306438489:  >>> depclean
1306438496: === Unmerging... (sys-kernel/gentoo-sources-2.6.35-r12)
1306438563:  >>> unmerge success: sys-kernel/gentoo-sources-2.6.35-r12
1306438563: === Unmerging... (dev-lang/python-2.6.6-r1)
1306438580:  >>> unmerge success: dev-lang/python-2.6.6-r1
1306438580: === Unmerging... (sys-kernel/gentoo-sources-2.6.36-r5)
1306438592:  >>> unmerge success: sys-kernel/gentoo-sources-2.6.36-r5
1306438592: === Unmerging... (virtual/libusb-0)
1306438593:  >>> unmerge success: virtual/libusb-0
1306438593: === Unmerging... (sys-kernel/gentoo-sources-2.6.36-r8)
1306438605:  >>> unmerge success: sys-kernel/gentoo-sources-2.6.36-r8
1306438605: === Unmerging... (sys-libs/db-4.5.20_p2-r1)
1306438607:  >>> unmerge success: sys-libs/db-4.5.20_p2-r1
1306438607: === Unmerging... (dev-libs/libusb-0.1.12-r5)
1306438609:  >>> unmerge success: dev-libs/libusb-0.1.12-r5
1306438609:  *** exiting unsuccessfully with status 'None'.
1306438611:  *** terminating.



# emerge --help || echo fail
fail

Similary python -V fail silently

Expected Results:  
emerge and python should still run after emerge --depclean

emerge --info
Portage 2.1.9.49 (hardened/linux/x86, gcc-4.4.5, glibc-2.12.2-r0, 2.6.27.59 i686)
=================================================================
System uname: Linux-2.6.27.59-i686-AMD_Athlon-TM-_XP_3000+-with-gentoo-2.0.2
Timestamp of tree: Wed, 25 May 2011 09:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:          4.1_p9
dev-lang/python:          2.7.1-r1, 3.1.3-r1
dev-util/ccache:          2.4-r9
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.2-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.65-r1
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.2.10
sys-devel/make:           3.81-r2
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon-xp -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=athlon-xp -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync3.fr.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups cvs cxx dri gdbm gpm hardened iconv modules mudflap ncurses nls nptl nptlonly old-hd-rules openmp pam pcre perl pic pppd python readline session ssl sysfs tcpd urandom vhost x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

I set the severity to normal as depclean is not a so current operation.
With information from this report, that's easy to unbreak emerge. But emerge was fully broken, so that could have being set at major level.
It take me some days to understand and find a solution.

This machine has been installed in 2005, so have survived to a lot of changes.
Comment 1 Pacho Ramos gentoo-dev 2011-05-29 17:26:51 UTC
You probably forgot to run python-updater after updating python
Comment 2 Gilles Espinasse 2011-05-29 21:28:29 UTC
I hadn't any special will to update python and I didn't ask a manual update of python before the breakage.

emerge --update updated python for me, and I don't remember any warning that I need to run python-updater manually.

The question I can't answer is why emerge --depclean had conclude python2.6.6 could be removed when it was still essential, at least for emerge itself.
Comment 3 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-05-31 14:21:02 UTC
(In reply to comment #2)
> I hadn't any special will to update python and I didn't ask a manual update of
> python before the breakage.
> 
> emerge --update updated python for me, and I don't remember any warning that I
> need to run python-updater manually.

The python ebuild includes such a notice.

> 
> The question I can't answer is why emerge --depclean had conclude python2.6.6
> could be removed when it was still essential, at least for emerge itself.

emerge --depclean did its job as you asked it to do. You have to check that you don't need any of the packages:

 * Always study the list of packages to be cleaned for any obvious
 * mistakes

All in all, it seems you didn't follow the instructions you were given. The messages are there to be read by you, not to be ignored by you.
Comment 4 Gilles Espinasse 2011-06-01 06:41:54 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > 
> > emerge --update updated python for me, and I don't remember any warning 
> > that I need to run python-updater manually.
> 
> The python ebuild includes such a notice.

I know for the warning in the ebuild. But even with the caution to repeat all warning messages at end of emerge, a warning may be out of screen when I come back to see the emerge result. This even happen with only 2 packages emerged.

Try for example (with due care to python-2.7 removal)
emerge --unmerge dev-lang/python:2.7
emerge dev-lang/python:2.7 subversion

and you have to stay in front of the machine during the second emerge to see the python warning because 'Messages for package dev-vcs/subversion-1.6.16' use full screen size.

Anyway, not running python-updater was for sure not the issue as I had python2.6 selected and working before the problem happen.
> 
> > 
> > The question I can't answer is why emerge --depclean had conclude 
> > python2.6.6 could be removed when it was still essential, at least for
> > emerge itself.
> 
> emerge --depclean did its job as you asked it to do. You have to check that
> you don't need any of the packages:
> 
>  * Always study the list of packages to be cleaned for any obvious
>  * mistakes
> 
I read that sentence too. For me, that was far from obvious, knowing python2.7 and 3.1 installed, that python2.6 can't be removed.
Probably the sentence could be enlighed for the way to check dependencies adding :
using 'equery depends <package-name>' and eselect python --list

I learn that the hard way, finding the python symlink mess
/usr/bin/python2 -> python2.6
/usr/bin/python -> python-wrapper
and run python-config to know that python2.6 is the default


> All in all, it seems you didn't follow the instructions you were given. The
> messages are there to be read by you, not to be ignored by you.

I don't really subscribe to the point of view this is resolved but I appreciate the various help and the volontary work made on gentoo.

I only could follow messages that I have seen with the knowledge I had at that time. Once you run emerge --update --deep --newuse world, you are instructed to run emerge --depclean. I do that and this once broke python and emerge.

I understand that's hard to fix as I can't replicate. Even by emerging again 2.6, 2.7, 3.1, --depclean no more remove 2.6 (with python 2.6 or 2.7 selected as default).
Using 'equery depends python', I understand no package require specifically 2.6.
I am a bit unsure about the gory details about portage :
sys-apps/portage-2.1.9.42 (!python2 & !python3 & !build? dev-lang/python:2.6)
                          (!python2&!python3&!build? dev-lang/python:2.7)
                          (!python2&!python3&build? dev-lang/python:2.6)
                          (!python2&!python3&build? dev-lang/python:2.7)
                          (python2&!python3? dev-lang/python:2.6)
                          (python2&!python3? dev-lang/python:2.7)
                          (python3? =dev-lang/python-3*)
                          (!python2&!python3&!build? >=dev-lang/python-3)
Why there is spaces on the first line to separate the conditions and not on next lines?

I selected 2.7 and used emerge --unmerge dev-lang/python:2.6 and everything look to work.
Comment 5 Pacho Ramos gentoo-dev 2011-06-01 08:10:21 UTC
Maybe "emerge --depclean" could be enhanced to skip python removal of version used by itself :-/