# pkg_add to download packages for install later or on another computer



## kpedersen (Apr 18, 2009)

Hello,

I am having a very hard time with the packages system and I am wondering if anyone can give me a hand.

Basically, an offline lab at my university with computers running FreeBSD 7.1 need to have KDE installed. On my online laptop also running FreeBSD 7.1, is there any way I can download the KDE package and all of its dependencies without installing it on my laptop.

I have tried...

pkg_add -K -r -n kde

... but that fails. If I get rid of the -n, it downloads everything fine but installs on my laptop and for some reason -K doesn't do anything... I still don't have my KDE offline installer files saved in the current directory.

If not I will simply have to copy the whole packages directory onto a usb hard drive but I am trying to save a lot of bandwidth here!

Once I have a folder containing all the KDE packages, I think the rest will be easy using the PKG_PATH export on the computers in the lab.

Best Regards,

Karsten


----------



## MG (Apr 19, 2009)

pkg_fetch -R kde 

Use PACKAGES environment variable to set a different target directory (default is /usr/ports/packages)

edit: pkg_fetch is part of the portupgrade port


----------



## Mel_Flynn (Apr 19, 2009)

kpedersen said:
			
		

> If I get rid of the -n, it downloads everything fine but installs on my laptop and for some reason -K doesn't do anything...


Try defining PKGDIR, but if KDE is already installed on your laptop, nothing is downloaded, hence no packages. pkg_fetch as suggested may do what you want.


----------



## kpedersen (Apr 19, 2009)

Hello,

Thank you for the replies.

I tried pkg_fetch and it worked perfectly. It is just what I was looking for and more! (looking at the man file, I found that I can use an exact path to the desired ftp)

This will make setting up the lab much easier.

Thank you very much,

Karsten


----------

