Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Frequently Asked Questions
  • Search

AT3: Can I exclude parts of the Portage tree?

Some of the most commonly heard questions in the Gentoo Community, along with answers.
Post Reply
Advanced search
1 post • Page 1 of 1
Author
Message
curtis119
Bodhisattva
Bodhisattva
User avatar
Posts: 2160
Joined: Mon Mar 10, 2003 4:41 pm
Location: Toledo, Ohio,USA, North America, Earth, SOL System, Milky Way, The Universe, The Cosmos, and Beyond.

AT3: Can I exclude parts of the Portage tree?

  • Quote

Post by curtis119 » Wed Jul 06, 2005 6:40 am

Navigation: [Advanced Topics] [Table of Contents]

Question: The portage tree takes up too much space with stuff I won't ever install and takes a long time to sync. What can I do?

The time Portage takes to download and process the tree (/usr/portage) can be decreased very easily by excluding parts of it. This will also free up valuable disk space since the portage tree is now over 400MB. This feature is available in portage-2.0.47-r3 and higher.

First add or uncomment the following line to /etc/make.conf

Code: Select all

# For portage-2.0.x
RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes
# For portage-2.1
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"

Next create the rsync_exludes file in /etc/portage and add the categories you want to exclude. Here is an example file that excludes all of the games categories, kde and media-sound.

Code: Select all

games-*/
kde-*/
media-sound/
Portage will not delete these directories if they already exist so you must manually remove them. Once removed portage will not recreate them. For example:

Code: Select all

rm -rf /usr/portage/games-action
Adding "--delete-excluded" to PORTAGE_RSYNC_EXTRA_OPTS, which will automatically delete directories added to the "--exclude-from" file on the next emerge --sync, will also delete all the files in distdir, since portage already excludes that directory. Deleting all the files in distdir on every emerge --sync is probably not what you want so manual deletion, as shown above, is recommended.

If you are attempting to emerge a package and get an error about missing dependencies check that it is not included in a category you excluded. You may add or remove categories from the rsync_exludes file at any time but it will not take effect until your next sync. To regain the entire portage tree simply comment out the RSYNC_EXCLUDEFROM or PORTAGE_RSYNC_EXTRA_OPTS line in /etc/make.conf and emerge --sync. Be careful not to exclude needed categories such as sys-apps.

For advanced information on directory/file pattern matching in your rsync_exludes file read the section "include/exclude pattern rules" in the rsync manpage. You can also try the script in this post (use at your own risk).

2006-06-16: Portage-2.1 changes, minor touch up. --kallamej
2006-07-05added note about "--delete-excluded" --curtis119[/i]
Gentoo: it's like wiping your ass with silk.
Top
Post Reply
1 post • Page 1 of 1

Return to “Frequently Asked Questions”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic