Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Depclean Safe Practices
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Mar 30, 2021 3:01 pm    Post subject: Depclean Safe Practices Reply with quote

I have had bad experiences with emerge --depclean in the past. Usually something like I forgot to emerge my kernel with --noreplace and its no longer in the tree and I don't yet want to upgrade it.

I have been doing some chroot crossbuilds and don't want to lose things I might still need. I am soon going to start using binpkg too, same for that. The thing is, I usually don't really know what I should have protected until it is already gone. I've yet to find written guidance that makes it clear to me. I'd RTFM if I knew where it was.

How do you deal with this? Aside from the obvious, "Well, upgrade it dummy."
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 821
Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.

PostPosted: Tue Mar 30, 2021 4:01 pm    Post subject: Reply with quote

Assuming I'm understanding you correctly: I just always do
Code:
emerge -pvc
beforehand.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31257
Location: here

PostPosted: Tue Mar 30, 2021 4:16 pm    Post subject: Reply with quote

I run emerge -ca and before say yes I check what PM want uninstall.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54577
Location: 56N 3W

PostPosted: Tue Mar 30, 2021 5:40 pm    Post subject: Reply with quote

flysideways,

I use --depclean -p, and look at what it wants to do.
Then I run --depclean -a with --exclude="packages I want to keep"
If the list looks good, I run it for real.

I like to keep two compiler versions and two sets of kernel sources installed.

binpackages are a bit harder.

For my public ~arm64 binhost, I don't prune it until I run out of HDD space, then it gets pruned to just the packages in the tree.
There is little point in offering binaries that need an old git checkout of the ::gentoo repo to actually use.

I keep all my distfiles, at least, since 2006. Other users have found that useful too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Mar 30, 2021 5:41 pm    Post subject: Reply with quote

I had forgotten that emerge --noreplace works on an already installed package. I have not yet tried it on an installed package already removed from the tree.

The best workflow is what was/is a bit vague for me.

I suppose to keep the World file to minimum clutter, --noreplace is not needed for the original emerge, but rather after finding the needed package in an emerge -pvc result. Then, later, after the protected package is indeed no longer needed, remove it from the World file, and run --depclean.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54577
Location: 56N 3W

PostPosted: Tue Mar 30, 2021 5:57 pm    Post subject: Reply with quote

flysideways,

Be wary of adding obsolete packages to world.
That will give you problems when portage needs to rebuild it but can't because the ebuild is gone.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 490

PostPosted: Tue Mar 30, 2021 6:01 pm    Post subject: Reply with quote

NeddySeagoon wrote:
flysideways,

I use --depclean -p, and look at what it wants to do.
Then I run --depclean -a with --exclude="packages I want to keep"
If the list looks good, I run it for real.


The man page mentions the --exclude option as won't install. I guess what it really means is that it will exclude those packages from the current action?

NeddySeagoon wrote:
I like to keep two compiler versions and two sets of kernel sources installed.

binpackages are a bit harder.

For my public ~arm64 binhost, I don't prune it until I run out of HDD space, then it gets pruned to just the packages in the tree.
There is little point in offering binaries that need an old git checkout of the ::gentoo repo to actually use.

I keep all my distfiles, at least, since 2006. Other users have found that useful too.


I've never really considered anything to do with "forensic" Gentoo packages but have grown to understand.

It's ok that stupid hurts, I only removed python once, a looong time ago. I would like to figure out my current workflow with the fewest bruises.

Thanks for the input all.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54577
Location: 56N 3W

PostPosted: Tue Mar 30, 2021 7:27 pm    Post subject: Reply with quote

flysideways,

Only Python?
--depclean removed glibc for me once. :)

It's for wee things like that that we have Fix My Gentoo
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2175

PostPosted: Wed Mar 31, 2021 8:00 am    Post subject: Re: Depclean Safe Practices Reply with quote

flysideways wrote:
I have had bad experiences with emerge --depclean in the past. Usually something like I forgot to emerge my kernel with --noreplace and its no longer in the tree and I don't yet want to upgrade it.

I have been doing some chroot crossbuilds and don't want to lose things I might still need. I am soon going to start using binpkg too, same for that. The thing is, I usually don't really know what I should have protected until it is already gone. I've yet to find written guidance that makes it clear to me. I'd RTFM if I knew where it was.
...

If it helps, I posted a script to protect kernel sources, assuming your kernels are all on /boot.

I thought about extending it to protect gcc slots; these days gcc upgrades seem to work without much problem, but once upon a time they were problematic. You'd obviously need different code to get the current gcc slot.

As to other stuff to protect, it's going to depend on what's important to you. For example, I guess a keen wine or steam user might wish to hang onto back-levels. A rust developer would probably do likewise at the moment, as it's a young language still evolving. For python that problem's so bad that Gentoo's taken (horrible) steps to manage it for you.

Keep a decent backup of your binpkgs (and/or don't run eclean), then you can manually fall-back. That has the advantage of protecting you against dependencies you hadn't realised were critical!
_________________
Greybeard
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9819
Location: almost Mile High in the USA

PostPosted: Tue Apr 06, 2021 3:57 pm    Post subject: Reply with quote

I've always used --pretend with --depclean , dumped all that output to a file, and manually separated the stuff I don't recognize (assumed to be orphans) and stuff I feel like keeping.

Then send all those known orphan packages through --depclean again, this time without --pretend . Sometimes I --select --noreplace those packages but not always - just so I can keep track of stuff that I really should delete at some point. (Honestly I don't know why I keep llvm-6 around.)

Yeah I spend way too much time depcleaning but it's the only way I figure I can get rid of everything I know I don't use directly but keep record of stuff that Gentoo thinks I should get rid of. Fear @world pollution...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3005
Location: Edge of marsh USA

PostPosted: Wed Apr 07, 2021 4:19 am    Post subject: Reply with quote

eccerr0r wrote:
I've always used --pretend with --depclean , dumped all that output to a file, and manually separated the stuff I don't recognize (assumed to be orphans) and stuff I feel like keeping.

In other words: (do this as an ordinary user)
Code:
emerge -cp > ~/portage/depclean20210406.txt

(The directory /home/USER/portage directory which has to be created by the user. You don't have to use the name "portage." I just like the name because it's my user's personal portage directory.)
Keep it as a reference, maybe forever. Tiny files will make a good history of what's been depcleaned. If unsure, study that file until you do understand it and the pretend depclean does what is intended. There is no urgency in doing the depclean. Take your time.

For many years I would add many packages to /var/lib/portage/world (-noreplace) just in case I might ever want to use them. I've reversed that practice almost 100%. If its something I don't actually use (like for a year or more) or need, I let it go. If I need it in the future, I'll emerge it then. I'm trying to keep a full-service but lean system. Over time, that will result in fewer unnecessary dependencies.

Every once in a while I notice something updating I don't think should be needed and go out and hunt down those dependencies, or dependencies of dependencies and the resulting "emerge -c atom" can be very satisfying, especially when it allows a large number of other packages to also be depcleaned. Keep it fun, like a game. Depclean has gotten a lot smarter, but it still depends on the user to keep it from causing a lot of grief.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
jcb__
n00b
n00b


Joined: 28 Aug 2024
Posts: 18

PostPosted: Wed Sep 04, 2024 2:32 am    Post subject: What the? Reply with quote

NeddySeagoon wrote:
flysideways,

Only Python?
--depclean removed glibc for me once. :)

It's for wee things like that that we have Fix My Gentoo


Sorry for making this topic come back to life but I was looking up more information on --depclean and saw this post.. how did you fix Your system after glibc was removed ? Reinstall?

Joe
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum