portage blows up when it tries to overwrite a dangling symlink on installation. Here's an easy way to demonstrate on a small package: # ln -sfn bogus /usr/libexec/mozilla-launcher # emerge mozilla-launcher ... >>> Merging net-www/mozilla-launcher-1.22 to / --- /usr/ --- /usr/libexec/ Traceback (most recent call last): File "/usr/bin/emerge", line 2991, in ? mydepgraph.merge(mydepgraph.altlist()) File "/usr/bin/emerge", line 1839, in merge retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug) File "/usr/lib/portage/pym/portage.py", line 2562, in doebuild return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["BUILDDIR"]+"/build-info",myroot,mysettings,myebuild=mysettings["EBUILD"]) File "/usr/lib/portage/pym/portage.py", line 2695, in merge return mylink.merge(pkgloc,infloc,myroot,myebuild) File "/usr/lib/portage/pym/portage.py", line 6670, in merge return self.treewalk(mergeroot,myroot,inforoot,myebuild,cleanup=cleanup) File "/usr/lib/portage/pym/portage.py", line 6297, in treewalk if self.mergeme(srcroot,destroot,outfile,secondhand,"",cfgfiledict,mymtime): File "/usr/lib/portage/pym/portage.py", line 6536, in mergeme if self.mergeme(srcroot,destroot,outfile,secondhand,offset+x+"/",cfgfiledict,thismtime): File "/usr/lib/portage/pym/portage.py", line 6536, in mergeme if self.mergeme(srcroot,destroot,outfile,secondhand,offset+x+"/",cfgfiledict,thismtime): File "/usr/lib/portage/pym/portage.py", line 6551, in mergeme elif stat.S_ISREG(mydmode) or (stat.S_ISLNK(mydmode) and stat.S_ISREG(os.stat(mydest)[stat.ST_MODE])): OSError: [Errno 2] No such file or directory: '/usr/libexec/mozilla-launcher' Be sure to fix it afterward, otherwise you'll next file a bug against me about mozilla-launcher. ;-) # rm -f /usr/libexec/mozilla-launcher # emerge mozilla-launcher ---- Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.8-gentoo-r4-kt600 i686) ================================================================= System uname: 2.6.8-gentoo-r4-kt600 i686 AMD Athlon(tm) XP 1800+ Gentoo Base System version 1.6.6 distcc 2.18 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.57-r1,sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.15.92.0.2-r1 Headers: sys-kernel/linux-headers-2.4.22 Libtools: sys-devel/libtool-1.5.2-r7 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -O3 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/X11/app-defaults /etc/X11/gdm /etc/X11/rstart /etc/X11/serverconfig /etc/X11/starthere /etc/X11/sysconfig /etc/X11/xdm /etc/X11/xinit /etc/X11/xkb /etc/ethereal /etc/gconf /etc/gnome-vfs-2.0 /etc/gtk-2.0 /etc/init.d /etc/pam.d /etc/postfix/sample /etc/sound /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -O3 -pipe" DISTDIR="/usr/distfiles" FEATURES="autoaddcvs ccache cvs distcc distlocks noclean sandbox sfperms userpriv usersandbox" GENTOO_MIRRORS="http://mirrors.tds.net/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j4" PKGDIR="/usr/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/local/home/agriffis/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X alsa apache2 apm avi berkdb bitmap-fonts bonobo cdr crypt cscope cups decss dga dvd encode evo f77 fam flac foomaticdb fortran gdbm gif gnome gstreamer gtk gtk2 gtkhtml guile imagemagick imap imlib java jpeg lcms libg++ libwww mad mailwrapper mikmod motif mozcalendar mozilla mpeg mysql ncurses nls ofx oggvorbis opengl oss pam pda pdflib perl png python qt quicktime readline ruby scanner sdl speex spell sqlite sse ssl tcltk tcpd tetex tiff truetype usb wmf x86 xml xml2 xmms xv zlib video_cards_radeon"
Fixed a while ago, but there was no bug. I'll attach the fix in a minute.
Created attachment 43841 [details, diff] 2.0.51-r3.bad.symlink.patch
*** Bug 70828 has been marked as a duplicate of this bug. ***
*** Bug 70819 has been marked as a duplicate of this bug. ***
Hi Jason. Thanks for pointing me this way. I'll try the patch and report on my experiences with it.
Hi, the patch worked, xorg installed okay. Thanks :)
*** Bug 73057 has been marked as a duplicate of this bug. ***
thx. fixed my texi2html-problem on ~ppc
This worked fine for my problem with xorg. :-)
I'm having the same problem while installing lapack after unmerging lapack-atlas. Will file a separate bug about lapack-atlas leaving this link behind. Any idea when the fix will get into mainstream Portage?
Yes, patch necessary. Please mainstream. (This for openssl on a system that went some months between updates.)
Saw this again today, running portage-2.0.51.19 this time. This instance was on a file /etc/._cfg*, so there might be some CONFIG_PROTECT magic mixed in.
I sincerely doubt that it was the same bug. Please open a new one with the error if it happens again.