Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 2009 00:32:01 +0100
From:      Polytropon <freebsd@edvax.de>
To:        "marco.borsatino@libero.it" <marco.borsatino@libero.it>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: installing packages
Message-ID:  <20090318003201.f03ddc8b.freebsd@edvax.de>
In-Reply-To: <13060403.254531237231322879.JavaMail.defaultUser@defaultHost>
References:  <13060403.254531237231322879.JavaMail.defaultUser@defaultHost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 16 Mar 2009 20:22:02 +0100 (CET), "marco.borsatino@libero.it" <marco.borsatino@libero.it> 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.)




#!/bin/sh
#
# pkg_download.sh
# ===============
#
# fetch a precompiled package as well as its dependencies
# for further installation
# 
# Written 2008-08-19

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

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

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}
done

rm $1.txt

exit 0





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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090318003201.f03ddc8b.freebsd>