For a long time we have been trying to come up with a way to have a binary package repository which is based on heterogeneous package sources. (pkg_add/ports)
After playing with “portupgrade” and “make package” which often failed due to various reasons, it became obvious this method wont be beneficial in long-term.
This howto explains how to create the exact package replica of a jail full of installed packages.
- First create a jail and build/install packages. I have created a build jail only for this purpose.
- Use the script posted below to backup currently installed packages and setup a package tree similar to “make package” used at ports build. (Modify the first line according to your needs)
The first loop backs up all the installed packages on the system to $PACKAGEDIR/All. Then by going through the packages again the script recreates the symlinks used in FreeBSD packaging. It also checks for package files with different versions (but same origin) and deletes those which are not installed.
A common roll-back scenario
To be deleted: mysql-server-5.1.45.tbz
Packages with different versions that can co-exist on the same system
To be deleted: none
The script checks for package origins and by determining that lang/ruby18 is different from lang/ruby19 both packages remain untouched and included to the repository.
Known bugs: Does not check for deleted packages. It’s better to recreate the whole repository after a big portupgrade anyway.
- Put the files onto a webserver using the following directory scheme:
- Use this as a source with pkg_add (or pkg_replace):
pkg_add -r bashwill fetch from the following URL:
Posted 2010/03/23 23:10 by jos