On 2/10/26 9:13 AM, Alan Mackenzie wrote:
As I say I don't trust --depclean.  I check its suggestions carefully,
then delete (some of) them by hand.  For example, I don't let it remove
older kernel packages, or older gcc versions.


If one manages the world file correctly, there's no reason not to trust it.  Sure, don't run it blindly, without -a, just in case one wants to keep a package and missed adding it to the world file but still, that isn't the fault of emerge.  I sometimes install a package to play with and forget to add it to the world file myself. A emerge -n --select y <package> corrects that tho.  The --select y overrides the --oneshot option in make.conf.

If you want to keep older versions of the kernel, gcc and others, just add that version to your world file.  Then --depclean won't try to remove it since it is in the world file.  I do that here and it works fine.  Examples for my kernel, gcc would work as well.



root@Gentoo-1 / # cat /var/lib/portage/world | grep gentoo-sources
sys-kernel/gentoo-sources:6.14.0
sys-kernel/gentoo-sources:6.9.10
sys-kernel/gentoo-sources:6.9.4
root@Gentoo-1 / #



When I run --depclean, emerge doesn't touch those versions of my kernels.  When I upgrade to a newer kernel, I may remove the oldest, from /boot and from the world file.  I usually keep 2 or 3 kernels just in case one gets corrupted or something.  I then add the new kernel, version to, to the world file.

I've posted this before and I suspect you won't do it this way but I'll post this again just in case.  When I first built this new rig and was installing my packages, my work flow was like this.  I did the base install download.  I edited the make.conf file and checked the USE flag line as the install guide explains.  I also added some packages to the correct files for some unstable packages as well.  I then updated the tree and all packages using emerge -auDN world.  I then started installing all the packages from the world file of my old system.  I started with the desktop environment, KDE for me, web browsers and worked my way down until I had everything I wanted on my new rig.  Some packages were just for my old system and not needed on the new system.  Once I had everything installed that *I* wanted, I added --oneshot to the emerge options in my make.conf file.  That way nothing gets accidentally added to my world file while I work around the occasional problems I may run into during updates or installing a new package dependency.  I've seen far to many post a problem with a upgrade and it ends up that there is clutter in the world file.  Things that are there, even versioned packages, that should not be there at all.  It almost always happens because a person didn't know to use --oneshot or forgot to use it. It's a very easy mistake.  I did that a lot before adding --oneshot to make.conf and emerge options.

My upgrade process is quite simple and works very well even tho I have some stable and some unstable packages.  That's something most don't recommend.  I sync the tree, I use eix-sync, and then run emerge -auDN world and look for any USE flag changes I don't like. I change USE flags if needed, usually don't, and then let the upgrade proceed, restarting emerge command if I made USE flag changes.

For the most part, my updates are no harder than a binary based distro.  I check for updates, check for USE flag changes, then update.  Most of the time, without any problems.

One thing I've learned, if a person has a lot of problems updating, usually it is because the person isn't using the right method or bad entries are in the world file or somewhere in /etc/portage/*.  If you try to apply what you think in place of how emerge expects things to be done, you cause problems in most cases.  Even when I started using Gentoo back in 2003, it didn't take me long to figure out how emerge wanted me to do things.  Once I learned how to do what it expects, my life got a lot easier.  Today, emerge and the work the devs do make it a whole lot easier.  Today, emerge manages deps and such a LOT better.  The devs have really done a awesome job making emerge work better.  The trick is, don't argue with emerge, learn what it expects and then do it that way.  You try to argue with emerge, you make it hard on yourself or you just lose the argument.

Now it's up to you how you want to proceed.  Just thought I'd share some info that just might help, you or some other person that hasn't learned the lessons I have, yet.  If you need more details, just ask.

Dale

:-)  :-)

Reply via email to