Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13055 - Portage uninstalling wrong versions
Summary: Portage uninstalling wrong versions
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-01 18:34 UTC by Maik Schreiber
Modified: 2011-10-30 22:17 UTC (History)
0 users

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 Maik Schreiber 2003-01-01 18:34:12 UTC
On my server box, Portage 2.0.46-r4 insists to delete the wrong package versions:

# emerge -pc

>>> These are the packages that I would unmerge:

 dev-perl/TermReadKey
    selected: 2.19-r1
   protected: 2.19
     omitted: none

 sys-apps/xinetd
    selected: 2.3.9
   protected: 2.3.7
     omitted: none

 app-admin/ufed
    selected: 0.2
   protected: 0.1
     omitted: none

 net-misc/ntp
    selected: 4.1.1b-r3
   protected: 4.1.1b-r1
     omitted: none

>>> Packages in red are slated for removal.
>>> Packages in green will not be removed.


I know this shouldn't be happening, but I really don't have a clue what's going
on here. I reinstalled portage-2.0.46-r4 to make sure, but to no avail.

Right now, I have to manually execute "emerge -C
'<category/package-newestversion'" to make sure Portage doesn't delete important
files (I've had this happened with shadow, resulting in a missing /bin/su! I
just noticed that by pure coincidence.)

For the time being, I'm not uninstalling packages on the box right now, so if
you need any more info or files from the box, _please_ ask me.

Here the "emerge info" from that box:

Portage 2.0.46-r4 (default-1.0, gcc-2.95.3, glibc-2.2.5-r7)
=================================================================
System uname: 2.4.18 i686 Pentium III (Katmai)
USE="x86 apm crypt encode gif imlib jpeg libg++ mmx motif mpeg ncurses svga
truetype xml2 xv berkdb gdbm java libwww pam png python readline slang ssl tcpd
tiff -3dnow -arts -avi -cups -gpm -gtk -kde -mikmod mysql -nls -oggvorbis
-opengl -oss -pdflib perl -qt -qtmt -quicktime sasl -sdl -spell -X -xmms"
ARCH="x86"
COMPILER=""
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O3 -funroll-loops -pipe"
CXXFLAGS="-march=i686 -O3 -funroll-loops -pipe"
ACCEPT_KEYWORDS="x86"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /opt/jakarta/tomcat/conf"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
MAKEOPTS=""
JDK_HOME="/opt/sun-jdk-1.4.1.01"
JAVA_HOME="/opt/sun-jdk-1.4.1.01"
AUTOCLEAN="no"
SYNC="rsync://localhost/gentoo-portage"
GENTOO_MIRRORS="ftp://ftp.sunsite.dk/mirrors/gentoo"
Comment 1 Maik Schreiber 2003-01-01 18:36:35 UTC
One thing I forgot to say: I'm using the same Portage version on my home box,
and there's no problem with it. Again, I don't have a clue what's going on here :-(

Here's the info from my home box:

Portage 2.0.46-r4 (default-1.0, gcc-2.95.3, glibc-2.2.5-r7)
=================================================================
System uname: 2.4.20-bz1 i686 AMD Athlon(tm) Processor
USE="x86 oss 3dnow apm avi crypt cups jpeg libg++ libwww mikmod mmx mpeg ncurses
quicktime truetype xml2 xmms xv berkdb bonobo cdr esd gdbm gif gnome-libs gpm
gtk guile imlib java ldap mozilla nls oggvorbis opengl pam perl png readline sdl
slang ssl tcltk tiff X alsa -arts dvd -encode gnome jikes -kde -motif mysql
-pdflib -python -qt -qtmt samba sasl -spell -svga -tcpd"
ARCH="x86"
COMPILER=""
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O3 -funroll-loops -pipe"
CXXFLAGS="-march=i686 -O3 -funroll-loops -pipe"
ACCEPT_KEYWORDS="x86 ~x86"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
MAKEOPTS=""
JDK_HOME="/opt/sun-j2sdk-1.4.0"
JAVA_HOME="/opt/sun-j2sdk-1.4.0"
AUTOCLEAN="no"
SYNC="rsync://194.97.4.250/gentoo-portage"
GENTOO_MIRRORS="ftp://ftp.sunsite.dk/mirrors/gentoo"
Comment 2 Maik Schreiber 2003-01-01 18:48:57 UTC
In http://article.gmane.org/gmane.linux.gentoo.devel/6083, a user describes
having about the same Problem - Portage insisting on deleting newer versions,
while keeping old ones. Again, this results in missing files.

(The user seems to be using AUTOCLEAN=yes and having installed some ~x86
packages, while having ACCEPT_KEYWORDS="x86" at the same time. Those facts
should really be irrelevant IMHO.)
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2003-01-02 08:18:05 UTC
theses packages are all stable
even on my 1.2 gentoo
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2003-01-02 19:41:54 UTC
Use a newer portage if you are sure it's only unmerging the most
recently installed versions... probably a counter problem.

If it's a counter problem the update should fix your problems.
You should 'emerge -e world' after getting on portage-2.0.46-r5

You may have a great deal of counter corruption if the update
doesn't fix it. You could have hit a bad mirror and got a zero'd
package.mask like I did. And portage is now unmerging the old
versions.


Comment 5 Maik Schreiber 2003-01-03 06:21:33 UTC
As I expected from having remerged portage-2.0.46-r4 before, the update to
portage-2.0.46-r5 didn't work.

Since you said something about counters, I had a quick look: In /var/db/pkg, the
COUNTER for portage-2.0.46-r4 is 19, while the COUNTER for 2.0.46-r5 is 14. What
exactly do these numbers mean?

The thing is, I want to understand how that counter mechanism works, so that I
can perhaps fix my db myself. I find remerging all 193 packages really not
acceptable.

Any help is deeply appreciated!
Comment 6 Maik Schreiber 2003-01-03 06:26:17 UTC
Now that's interesting: After I updated to portage-2.0.46-r5, "emerge -pc"
showed me the same behaviour I described.

Now, I've just updated Mail-SpamAssassin and Time-HiRes, and for those two it
works! I will try and clean those two, if it doesn't work, I will add another
comment here.

 sys-apps/portage
    selected: 2.0.46-r5
   protected: 2.0.46-r4
     omitted: none

 dev-perl/Time-HiRes
    selected: 01.20-r2
   protected: 1.38
     omitted: none

 dev-perl/Mail-SpamAssassin
    selected: 2.43-r2
   protected: 2.43-r3
     omitted: none
Comment 7 Maik Schreiber 2003-01-03 09:08:10 UTC
Alright, this has been identified as COUNTERs in /var/db/pkg having the wrong order.

I've written a script that fixes this: http://cvs.gentoo.org/~blizzy/fix-db.pl

Make sure to backup /var/db/pkg/* first! (/var/cache/edb/counter can be deleted
safely, no need to backup.)


Carpaski, perhaps I just leave this bug open for you to add stuff to Portage?
Comment 8 Benjamin Weber 2003-01-06 04:20:21 UTC
I tried using the script because I encountered the same strange behavior.
It resulted in:

rabbing db contents...
Grabbing mtimes...
fix-db: fatal: insufficient data for app-text/docbook-sgml-1.0
Comment 9 Maik Schreiber 2003-01-07 08:48:44 UTC
Benjamin: Yes, these errors are quite common if there is not enough data to be
found in a package's CONTENTS file.

Workaround: Remove the package's complete directory from /var/db/pkg, then
re-run the script. If all goes well, you just need to remerge the package after
the script is done (so to not break any dependencies).
Comment 10 Nicholas Jones (RETIRED) gentoo-dev 2003-02-22 11:26:10 UTC
Pulled the script into portage.
It's there, as a just-in-case.