Portage/Help/Migrating to new repository data locations
From Gentoo Wiki
Jump to:navigation
Jump to:search
About
This page gives a set of instructions for how to migrate from the old repository/data locations to the new locations used in e.g. stage3s going forward.
See bug #662982 for background and motivation.
Old/new locations
Purpose | Old path | New path |
---|---|---|
Storing the tree / ebuilds | /usr/portage | /var/db/repos/gentoo |
Distfiles (downloaded source code/files) | /usr/portage/distfiles | /var/cache/distfiles |
Binary packages | /usr/portage/packages | /var/cache/binpkgs |
Instructions
Originally written by kurly from #gentoo.
Note
If you use a separate partition for /usr/portage, you may want to consider how this affects your disk usage and may need /etc/fstab changes.
If you use a separate partition for /usr/portage, you may want to consider how this affects your disk usage and may need /etc/fstab changes.
- Remove (or comment out) any PORTDIR, DISTDIR, PKGDIR entries in /etc/portage/make.conf
- Note the output of eselect profile show for later
- If /var/db/repos/ does not exist, create it:
root #
ls -1 /var/db/repos
- Move /usr/portage/distfiles to /var/cache/distfiles
- Move /usr/portage/packages to /var/cache/binpkgs
- Move /usr/portage to /var/db/repos/gentoo
- Edit the 'location' variable in /etc/portage/repos.conf/gentoo.conf (or equivalent) to /var/db/repos/gentoo
- Use eselect profile set ____ with the profile noted earlier
- Reinstall portage: DISTDIR=/var/cache/distfiles PKGDIR=/var/cache/binpkgs emerge --oneshot portage
Additional steps:
- If you run a local rsync mirror, edit the path entry in /etc/rsyncd.conf to point to /var/db/repos/gentoo
- If you share your distfiles, remember to update whatever symlink or config file you need for that
Commands
Roughly:
root #
mkdir /var/db/repos
root #
mv /usr/portage/distfiles /var/cache
root #
mv /usr/portage/packages /var/cache/binpkgs
root #
mv /usr/portage /var/db/repos/gentoo
root #
sed -i -e 's:/usr/portage/packages:/var/cache/binpkgs:' /etc/portage/*
root #
sed -i -e 's:/usr/portage/distfiles:/var/cache/distfiles:' /etc/portage/*
root #
sed -i -e 's:/usr/portage:/var/db/repos/gentoo:' /etc/portage/*
root #
DISTDIR=/var/cache/distfiles PKGDIR=/var/cache/binpkgs emerge --oneshot portage