# Upgrading jail with ezjail-admin



## abi (Oct 29, 2013)

Hey.

I've upgraded my base system to 9.2-RELEASE with the binary update without any issues and tried to upgrade my jails with the -U option. Here is my output.


```
abi@serpent:/home/abi % sudo ezjail-admin update -U -s 9.1-RELEASE
Password:
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 9.1-RELEASE from update5.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Fetching 2 metadata files... done.
Inspecting system... done.

WARNING: This system is running a "echidna" kernel, which is not a
kernel configuration distributed as part of FreeBSD 9.1-RELEASE.
This kernel will not be updated: you MUST update the kernel manually
before running "/usr/sbin/freebsd-update install".

The following components of FreeBSD seem to be installed:
world/base world/doc world/games world/lib32

The following components of FreeBSD do not seem to be installed:
kernel/generic src/src

Does this look reasonable (y/n)? y

Fetching metadata signature for 9.2-RELEASE-p1 from update5.freebsd.org... failed.
Fetching metadata signature for 9.2-RELEASE-p1 from update4.freebsd.org... failed.
Fetching metadata signature for 9.2-RELEASE-p1 from update6.freebsd.org... failed.
Fetching metadata signature for 9.2-RELEASE-p1 from update2.freebsd.org... failed.
Fetching metadata signature for 9.2-RELEASE-p1 from update3.freebsd.org... failed.
No mirrors remaining, giving up.
abi@serpent:/home/abi %
```

I found a little information about the practical usage of the -U option and my issue does not look like a connectivity problem. I found it strange that freebsd-update tried to fetch  9.2-RELEASE-p1 metadata. Isn't it supposed to fetch the 9.1 one?

AFAIK, the basejail was created from 9.1-RELENG sources if it matters.


----------



## junovitch@ (Oct 29, 2013)

I had no issues doing nearly the same thing, except I specified the patch level.  According to my notes, `# ezjail-admin update -U -s 9.1-RELEASE-p6` was the exact command I used.  Maybe try the -r flag to get around the mistaken -p1.  Example:  `# ezjail-admin update -U -s 9.1-RELEASE-p6 -r 9.2-RELEASE`.

What is the output of `uname -a`?


----------



## abi (Oct 30, 2013)

The -r flag is illegal as ezjail-admin parameter.

I enabled debug in freebsd-update, here is the output:

```
Fetching metadata signature for 9.2-RELEASE-p1 from update6.freebsd.org...
fetch: http://update6.freebsd.org/9.2-RELEASE-p1/amd64/latest.ssl: Not Found
failed.
```

This file actually does not exist.


```
FreeBSD serpent.is 9.2-RELEASE-p1 FreeBSD 9.2-RELEASE-p1 #3: Tue Oct 29 08:56:49 UTC 2013     root@serpent.is:/usr/obj/usr/src/sys/ECHIDNA  amd64
```


----------



## junovitch@ (Oct 31, 2013)

If you go to http://update6.freebsd.org in a browser there is no -p1 directory.  Sorry about the -r flag, I misread the man page and that was an install option.

More from the man page...

```
-U      Use freebsd-update(8) to upgrade the basejail to the hosts oper-
             ating system version, or a version you may pass freebsd-update's
             call to ``uname -r'' via the UNAME_r environment variable. Since
             there currently is no way of infering the osversion currently
             installed in the basejail, you need to remember the original
             osversion and pass it to this script using the -s option.
```

How about this.

```
setenv UNAME_r 9.2-RELEASE
ezjail-admin update -U -s 9.1-RELEASE-p6
```


----------



## abi (Oct 31, 2013)

Indeed. I missed the obvious. UNAME_r works.
Thank you!


----------



## danielr (Nov 7, 2013)

Here are the steps I took to upgrade the host to 9.2 and my jail to 9.2 (through ezjail-admin):

 `freebsd-update fetch`
 `freebsd-update install`
 `freebsd-update upgrade -r 9.2-RELEASE`
 `freebsd-update install`
 `ezjail-admin install -r 9.2-RELEASE`
 `env UNAME_r=9.2-RELEASE ezjail-admin update -s 9.1-RELEASE -U`

However I received here some 'no such file or directory' in this step:

```
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
Installing updates...install: /usr/jails/basejail//etc/libmap.conf: No such file or directory
install: /usr/jails/basejail//etc/periodic/daily/401.status-graid: No such file or directory
install: /usr/jails/basejail//etc/rc.d/auditdistd: No such file or directory
done.
```

 REBOOT
 `freebsd-update install`


```
HOST: $ uname -a : FreeBSD hetzner 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
JAIL: $ uname -a : FreeBSD WWW 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENER
JAIL: $ file /bin/ls : ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.2, stripped
```


----------

