View previous topic :: View next topic |
Author |
Message |
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 497 Location: San Diego, California USA
|
Posted: Wed Sep 20, 2023 11:43 pm Post subject: [SOLVED] Depclean but exclude kernel sources? |
|
|
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 |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1863
|
Posted: Wed Sep 20, 2023 11:50 pm Post subject: Re: Depclean but exclude kernel sources? |
|
|
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 |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 497 Location: San Diego, California USA
|
Posted: Thu Sep 21, 2023 4:44 pm Post subject: |
|
|
Thanks for the options. |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2292
|
Posted: Thu Sep 21, 2023 6:41 pm Post subject: |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3402 Location: Canada
|
Posted: Fri Oct 11, 2024 4:33 pm Post subject: Re: Depclean but exclude kernel sources? |
|
|
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 |
|
|
|