# Is it safe to unmerge gentoo-sources ?

## pa4wdh

Hi,

I just checked my /usr/src directory, and it currently contains about 2G of kernel sources  :Smile: 

I use the vanilla sources, but i see the most kernels of gentoo-sources (linux-<version>-gentoo-<release>. Is it safe to unmerge gentoo-sources to stop it from upgrading the (in my case unused) gentoo kernel sources ?

To show you what i mean, this is du -sk * from /usr/src:

```

407712  linux-2.6.12-gentoo-r6

422026  linux-2.6.14-gentoo-r2

248928  linux-2.6.14-gentoo-r4

249525  linux-2.6.14-gentoo-r5

330406  linux-2.6.14.2

253534  linux-2.6.15-gentoo-r1

347619  linux-2.6.15.1

258918  linux-2.6.16-gentoo-r3

```

And i would like to unmerge the gentoo-sources and delete the gentoo entry's in this directory.

Any advice ?

Best regards,

pa4wdh

----------

## SoylentGreen

 *pa4wdh wrote:*   

> Is it safe to unmerge gentoo-sources to stop it from upgrading the (in my case unused) gentoo kernel sources ?
> 
> 

 

yes. you could actually unmerge all unused kernel-sources

----------

## Naib

its actually quicker to delete the /usr/src/<DIRECTORY OF KERNEL>   and then unmerge it

during unmerge, portage checks every file. by deleting the source-tree first it speeds the whole unmerge of the kernel-source by at least x2. 

NOTE!!!!!!!!  only works for kernel source DO NOT DO THIS WITH OTHER PACKAGES

----------

## pa4wdh

Thanks for your quick response, saves a lot of disk space  :Smile: 

----------

## Dammital

Also see ecatmur's dep script.

----------

## SoylentGreen

 *Dammital wrote:*   

> Also see ecatmur's dep script.

 

pardon?

kernel sources could never be redundant, because the portage database is unable to know how many kernels you actually have installed in /boot.

IMHO this is the reason, why every new kernel is slotted differently, so it does not get deleted by default.

please keep in mind that plenty of use have more then one kernel in grub.conf.

well, i didnt read all of those 21 pages in the thread you mentioned, though.. if this tool actually deletes kernel-sources i dont wonder it is placed in "unsupported software"   :Twisted Evil: 

----------

## Dammital

Regardless, here's what <dep -P> did this morning:

1145809839:  *** emerge --verbose --ask unmerge gnome-extra/gal-1.99.11 gnome-extra/gal-2.4.3 gnome-extra/gtkhtml-3.6.2 sys-kernel/gentoo-sources-2.6.14-r5 x11-libs/wxGTK-2.4.2-r3

So however it does it, it's ditching kernel sources.

----------

## pa4wdh

 *Naib wrote:*   

> its actually quicker to delete the /usr/src/<DIRECTORY OF KERNEL>   and then unmerge it
> 
> during unmerge, portage checks every file. by deleting the source-tree first it speeds the whole unmerge of the kernel-source by at least x2. 
> 
> NOTE!!!!!!!!  only works for kernel source DO NOT DO THIS WITH OTHER PACKAGES

 

Thanks for the info, but if i don't unmerge it, i think it will keep on updating, is that true ? That's actually the thing i want to stop since i already have the vanillla sources.

Actually, i already unmerged all unused gentoo kernels, except 2 which i use as fallback until a newer vanilla kernel is released (so i have one in use and one fallback of that).

----------

## HeissFuss

If you don't want new gentoo-sources when you run emerge --update world remove the gentoo-sources entry from your world file (/var/lib/portage/world).

----------

