# How do I get install packages into jails from custom Poudriere repo on host?



## jgod (Jul 6, 2022)

I searched first, but can't find an example of this - I must be missing something.

I can install packages using a custom repo on the host, using poudriere:

```
$ doas pkg install dokuwiki
Password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating myrepo repository catalogue...
myrepo repository is up to date.
All repositories are up to date.
The following 22 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        dokuwiki: 20200729 [myrepo]
        fontconfig: 2.13.94_2,1 [myrepo]
        freetype2: 2.12.1 [myrepo]
        giflib: 5.2.1 [myrepo]
        jbigkit: 2.1_1 [myrepo]
        jpeg-turbo: 2.1.3 [myrepo]
        libargon2: 20190702 [myrepo]
        libgd: 2.3.3,1 [FreeBSD]
        libimagequant: 2.17.0 [myrepo]
        libxml2: 2.9.13_2 [myrepo]
        oniguruma: 6.9.8_1 [myrepo]
        php74: 7.4.30 [myrepo]
        php74-gd: 7.4.30 [myrepo]
        php74-json: 7.4.30 [myrepo]
        php74-mbstring: 7.4.30 [myrepo]
        php74-openssl: 7.4.30 [myrepo]
        php74-session: 7.4.30 [myrepo]
        php74-xml: 7.4.30 [myrepo]
        php74-zlib: 7.4.30 [myrepo]
        png: 1.6.37_1 [myrepo]
        tiff: 4.3.0 [myrepo]
        webp: 1.2.2 [myrepo]

Number of packages to be installed: 22

The process will require 79 MiB more space.
205 KiB to be downloaded.

Proceed with this action? [y/N]:
```
However, I cannot get the pkg -j equivalent to work:

```
$ doas pkg -j dokuwiki install dokuwiki

Password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'dokuwiki' have been found in the repositories
```

These are my jails:

```
$ jls
   JID  IP Address      Hostname                      Path
     1                                                /jails/www0
     2                                                /jails/dokuwiki
```

What am I missing?


----------



## Andriy (Jul 6, 2022)

It's likely that you need to update the repo configuration within the jail.
I guess that pkg switches to the jail environment before doing anything else.


----------



## SirDice (Jul 6, 2022)

Yep, it jexec(1) into the jail to execute pkg(8) there. Thus you need to configure pkg(8) inside the jail. 


```
-j ⟨jail name or id⟩, --jail ⟨jail name or id⟩
             pkg will execute in the given ⟨jail name or id⟩, where name
             matches “jls name” and id matches “jls jid”.  See jail(8) and
             jls(8).
```


----------

