Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Depclean but exclude kernel sources?
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
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 497
Location: San Diego, California USA

PostPosted: Wed Sep 20, 2023 11:43 pm    Post subject: [SOLVED] Depclean but exclude kernel sources? Reply with quote

I want to manage the versions of the kernel sources I have on my machine manually. I'm using ~amd64 gentoo-sources and I update the running kernel on my machine about every 30 days. As newer versions of gentoo-sources come in I delete older ones I'm not using manually. What I end up with is the latest version of gentoo-sources plus the source trees of the kernels I have installed on my machine. I keep about the last 3 I have installed. I'm happy with that setup.

Now let's say I want to run emerge --depclean to get rid of old packages. Included in that list will be all of the older versions of gentoo-sources except the latest one. I don't want depclean to get rid of any of the gentoo-sources packages. I have to manually execute an emerge --depclean copying over all of the other packages except for the gentoo-sources packages I want to keep.

Is there an easier way to do this? Is there a way I can tell depclean to ignore gentoo-sources packages?


Last edited by gentoo_ram on Thu Sep 21, 2023 4:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1863

PostPosted: Wed Sep 20, 2023 11:50 pm    Post subject: Re: Depclean but exclude kernel sources? Reply with quote

gentoo_ram wrote:
Is there an easier way to do this? Is there a way I can tell depclean to ignore gentoo-sources packages?

emerge --depclean --ask --exclude sys-kernel/gentoo-sources Then clean them up at your leisure.

Alternatively, don't put "sys-kernel/gentoo-sources" in the world file alone. If the slot is installed, e.g. emerge --noreplace sys-kernel/gentoo-sources:5.15.127, it will remain installed until you ask it to be removed. It will not upgrade until you ask for a new sources as well.
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 497
Location: San Diego, California USA

PostPosted: Thu Sep 21, 2023 4:44 pm    Post subject: Reply with quote

Thanks for the options.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2292

PostPosted: Thu Sep 21, 2023 6:41 pm    Post subject: Reply with quote

Just a clarification I find important, if you exclude more than one packages, they should be in a quoted string, space separated. Otherwise only the first one will be excluded and the rest will be taken as arguments to emerge.

Best Regards,
Georgi
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3402
Location: Canada

PostPosted: Fri Oct 11, 2024 4:33 pm    Post subject: Re: Depclean but exclude kernel sources? Reply with quote

grknight wrote:
gentoo_ram wrote:
Is there an easier way to do this? Is there a way I can tell depclean to ignore gentoo-sources packages?

emerge --depclean --ask --exclude sys-kernel/gentoo-sources Then clean them up at your leisure.

Alternatively, don't put "sys-kernel/gentoo-sources" in the world file alone. If the slot is installed, e.g. emerge --noreplace sys-kernel/gentoo-sources:5.15.127, it will remain installed until you ask it to be removed. It will not upgrade until you ask for a new sources as well.



Yep, manpages though refer to --exclude as an option that prevents installation, but do not make explicit statement about deinstallation
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