# Export Installed Ports & Packages for Offline Installation



## jrt03 (Mar 22, 2012)

Apologies if my terminology is off, but I have a server that I've installed a custom kernel, several ports, and several packages on, and I need to deploy the exact same set of packages on about 50 other identical servers. 

Side Note: Originally I was only installing packages, but I ended up having to use ports meet some specific needs (e.g. python27 in pkgs is 2.7.1, while python27 in ports is 2.7.2)


Once my template machine is complete, what's the best way for me to export all installed ports and packages so they can be installed on the other machines offline?
Can I convert installed ports to packages?
At minimum, I would like to automate the installation of the ports/packages, but what are some beginning resources for automating the install FreeBSD and my custom kernel?

Any help is much appreciated


----------



## SirDice (Mar 22, 2012)

jrt03 said:
			
		

> 1) Once my template machine is complete, what's the best way for me to export all installed ports and packages so they can be installed on the other machines offline?


Set up a build server and build all your own packages. NFS export /usr/ports/packages/ or set up a web server that shares them. You can then use pkg_add(1) on the all the other machines.



> 2) Can I convert installed ports to packages?


Yes, with pkg_create(1).



> 3) At minimum, I would like to automate the installation of the ports/packages, but what are somebeginning resources for automating the install FreeBSD and my custom kernel?


A lot of the installation can be automated. The new bsdinstall isn't completely documented yet though. But I think I can remember a few threads dealing with it. I'll see if I can find them.

Edit: Found a thread with some pointers: Thread 2886


----------



## jrt03 (Mar 22, 2012)

Thanks SirDice!


I was able to export my ports and packages via pkg_create(1). When I go to reinstall them on my other machines, will I need to install them in a specific order or will pkg_add(1) know what it needs to do to install a dependency?
I'll read up on bsdinstall, but I don't have forum permissions to access the link you provided :\

Thanks again!


----------



## SirDice (Mar 22, 2012)

jrt03 said:
			
		

> 1) I was able to export my ports and packages via pkg_create. When I go to reinstall them on my other machines, will I need to install them in a specific order or will pkg_add know what it needs to do to install a dependency?


pkg_add(1) will know what needs to be done.



> 2) I'll read up on bsdinstall, but I don't have forum permissions to access the link you provided :\


Oops, me neither. Copy/pasted a couple of numbers short :r

This should be the correct one: Thread 28862


----------



## phoenix (Mar 22, 2012)

So long as all the packages are in the same directory, pkg_add(1) will Do The Right Thing, and install dependencies correctly.


----------



## Chris_H (Mar 27, 2012)

Greetings,
 You might also find this thread helpful:
forums.freebsd.org/showthread.php?t=30696
Best wishes.


----------

