installing packages

Polytropon freebsd at
Tue Mar 17 16:32:10 PDT 2009

On Mon, 16 Mar 2009 20:22:02 +0100 (CET), "marco.borsatino at" <marco.borsatino at> wrote:
> Hi, this are my questions.
> 1) I've installed many packages using pkg_add -rK [package] because
> I had the idea to use the same packages on a different PC. Packages
> are present in the directory i used as a repository, but only the
> requested packages, not the dependecies.
> When I tried on another PC pkg_add [package] (I've copied all the
> requested packages on a USB HD) the program tells me that it cannot
> find dependencies. What is my mistake?

As it has already been suggested, it may be that you missed some
dependencies. I'll equip you with my (dirtily hacked) pkg_download
script so you can be sure to have all the dependencies. You can
delete the -n option if you wish to download AND install the
packages. The default behaviour is to fetch them only. (Original
intention: Download package and dependencies on system A with
Internet access, copy the result to system B without Internet
access, and then install them there.)

# ===============
# fetch a precompiled package as well as its dependencies
# for further installation
# Written 2008-08-19

if [ "$1" = "" ]; then
	echo "$0 <package>"
	exit 1

echo -n "fetching $1 ... "
if [ -f $1.tbz ]; then
	echo "$1.tbz already there"
	exit 1

pkg_add -fKnrv $1 > $1.txt 2>&1
# -f = force, -K = keep, -n = no install, -r = remote, -v = verbose

echo "done"

for DEP in `cat $1.txt | grep $1 | grep "depends on" | cut -d "'" -f 6 | cut -d "/" -f 2`; do
	echo "dependency for $1 is ${DEP}"
	$0 ${DEP}

rm $1.txt

exit 0

>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list