# Jail binary upgrade



## Sebastian (Apr 11, 2020)

Hello I have upgrade my host to 12.1, which seems to work fine. Now I'm trying to update my jails via this command.



```
freebsd-update -b /zroot/jails/box --currently-running 12.0-RELEASE -r 12.1-RELEASE fetch install
```

There is no error if I'm doing this , but If I start the jail again. The jails think it runs an old one ? I don't know how this should be possible , because the jail uses the kernel from the host right ?

All my jails are created as fulljails. "Jails the hard way"


```
root@box:/ # pkg-static install -f pkg
Updating FreeBSD repository catalogue...
pkg-static: Repository FreeBSD has a wrong packagesite, need to re-create database
[box] Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
[box] Fetching packagesite.txz: 100%    6 MiB   2.2MB/s    00:03
Processing entries:   0%
Newer FreeBSD version for package gpgme-qt5:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1201000
- running kernel: 1200086
Ignore the mismatch and continue? [Y/n]: ^Cpkg-static:
signal received, cleaning up

root@box:/ # uname -k
uname: illegal option -- k
usage: uname [-aiKmnoprsUv]
root@box:/ # uname -K
1201000
```

Any suggestions?

HOST:

```
BSD  sharky@freebsd  ~                                                                                                 6511
╰─ uname -U
1201000
BSD  sharky@freebsd  ~                                                                                                 6512
╰─ uname -K
1201000
```
Jail:

```
root@box:/ # uname -K
1201000
root@box:/ # uname -U
1200086
```


----------



## Sebastian (Apr 11, 2020)

I think I got it. If i ran  freebsd-update -b /zroot/jails/box --currently-running 12.0-RELEASE -r 12.1-RELEASE fetch install 

from the host

It only updates the kernel and not world/base world/doc world/lib32 . 

Do I hit a bug or is that intended ?


----------



## T-Daemon (Apr 11, 2020)

Sebastian said:


> freebsd-update -b /zroot/jails/box --currently-running 12.0-RELEASE -r 12.1-RELEASE *fetch install*



You need the `upgrade` command instead of `fetch install`, see freebsd-update(8).

`freebsd-update -b /zroot/jails/box  --currently-running 12.0-RELEASE  -r 12.1-RELEASE upgrade`


----------



## Sebastian (Apr 12, 2020)

I would like to share my experience.

Update from the host works perfectly .... 


```
freebsd-update -b /usr/local/jails/unifi --currently-running 12.0-RELEASE -r 12.1-RELEASE upgrade

freebsd-update -b /usr/local/jails/unifi --currently-running 12.0-RELEASE -r 12.1-RELEASE install

freebsd-update -b /usr/local/jails/unifi --currently-running 12.0-RELEASE -r 12.1-RELEASE install

mount -t devfs devfs /usr/local/jails/unifi/dev

pkg --chroot /usr/local/jails/unifi/ install -y pkg

pkg --chroot /usr/local/jails/unifi/ upgrade -f


freebsd-update -b /usr/local/jails/unifi --currently-running 12.0-RELEASE -r 12.1-RELEASE install
```


Start the jail


----------



## T-Daemon (Apr 12, 2020)

Sebastian said:


> freebsd-update -b /usr/local/jails/unifi *--currently-running* 12.0-RELEASE *-r *12.1-RELEASE install
> freebsd-update -b /usr/local/jails/unifi *--currently-running* 12.0-RELEASE *-r *12.1-RELEASE install



The highlighted options are superfluous in that context, and they won’t be respected.  `--currently-running` is useful when upgrading jails, done with the `upgrade` command and option `-r` is valid with the `upgrade` command only, see freebsd-update(8).


----------



## Dmitry Samersoff (Jan 2, 2022)

The following doesn't work for me. It installs kernel and update some files (like master.passwd) but don't update userland binaries.

```
freebsd-update -b /jails/${jail}/ --currently-running 12.1-RELEASE -r 12.3-RELEASE upgrade
freebsd-update -b /jails/${jail}/ install
freebsd-update -b /jails/${jail}/ install
```


----------



## grahamperrin@ (Jan 4, 2022)

Dmitry Samersoff said:


> … userland binaries.



If those binaries are not within world (FreeBSD = kernel + world) then you must use something other than freebsd-update. 

pkg-update(8) in the jail  … I guess.


----------

