# Install package inside jail vs install package from outside



## japoc (Nov 23, 2015)

Hi,

I'm experimenting with jails and I can see two ways of installing packages (using the `pkg` command).
For example, to install vim:

either log into the jail and run

`# pkg install vim`

or, from the host

`# pkg -j myjail install vim`

I can see the benefit of the first way (from inside the jail): I can write one deployment script, and don't worry about whether someone runs it on a physical host or inside a jail. The command is the same.

So what's the use of the second way?


----------



## wblock@ (Nov 23, 2015)

Being able to work on jails as an admin on the host system.


----------



## japoc (Nov 23, 2015)

That's it? I was worried that packages installed from the host could not be upgraded from inside the jail, or similar problems.


----------



## wblock@ (Nov 23, 2015)

The packages are the same.  The difference is that administrators do not have to log in to each jail to do it.  That feature got applause when it was first described at BSDCan.


----------

