Difference between revisions of "gentoo disk space cleanup"

From thelinuxwiki
Jump to: navigation, search
(Created page with " == Some common space hogs == == removing distfiles== rm /usr/portage/distfiles/* == removing old kernel sources == emerge --ask --depclean gentoo-sources [[category:gen...")
 
(removing old kernel sources)
Line 7: Line 7:
  
 
== removing old kernel sources ==
 
== removing old kernel sources ==
 +
 +
Just a couple old kernel sources can consume multiple Gigabytes as seen below
 +
 +
# du -sh /usr/src/*                                                                                  /usr/src
 +
0      /usr/src/linux
 +
946M    /usr/src/linux-3.4.9-gentoo
 +
1001M  /usr/src/linux-3.5.4-gentoo
 +
1021M  /usr/src/linux-3.7.4-gentoo
 +
 +
# du -sh
 +
2.9G    /usr/src/
 +
 +
'''DON'T blow them away with rm, use emerge'''
 +
 
  emerge --ask --depclean gentoo-sources
 
  emerge --ask --depclean gentoo-sources
 +
 +
'''Protecting sources'''
 +
 +
Use --noreplace to protect and sources which you don't want removed
 +
 +
example:
 +
root # emerge --ask --noreplace gentoo-sources:3.3.8
  
 
[[category:gentoo]]
 
[[category:gentoo]]

Revision as of 02:26, 12 March 2013

Some common space hogs

removing distfiles

rm /usr/portage/distfiles/*

removing old kernel sources

Just a couple old kernel sources can consume multiple Gigabytes as seen below

# du -sh /usr/src/*                                                                                   /usr/src
0       /usr/src/linux
946M    /usr/src/linux-3.4.9-gentoo
1001M   /usr/src/linux-3.5.4-gentoo
1021M   /usr/src/linux-3.7.4-gentoo
# du -sh 
2.9G    /usr/src/

DON'T blow them away with rm, use emerge

emerge --ask --depclean gentoo-sources

Protecting sources

Use --noreplace to protect and sources which you don't want removed

example:

root # emerge --ask --noreplace gentoo-sources:3.3.8