Solved Upgrading a jail says "No such file or directory"

Hi,

I am trying to upgrade a jail template (it is not running). The jail is located in /usr/local/jail/base. I am doing the following:

Code:
$ sudo freebsd-update fetch -F -b /usr/local/jail/base -d /usr/local/jail/base/var/db/freebsd-update
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 11.1-RELEASE from update5.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files will be added as part of updating to 11.1-RELEASE-p9:
/usr/src/contrib/file/magic/Magdir/apache
/usr/src/contrib/file/magic/Magdir/bhl
/usr/src/contrib/file/magic/Magdir/gconv
/usr/src/contrib/file/magic/Magdir/gpu
/usr/src/contrib/file/magic/Magdir/webassembly
/usr/src/contrib/file/magic/Magdir/yara
/usr/src/contrib/file/tests/hddrawcopytool.result
/usr/src/contrib/ntp/sntp/m4/ntp_af_unspec.m4
/usr/src/contrib/ntp/sntp/tests/testconf.yml
/usr/src/contrib/tzdata/calendars
/usr/src/contrib/tzdata/theory.html
/usr/src/contrib/tzdata/ziguard.awk
/usr/src/contrib/tzdata/zishrink.awk

Then I run this:

Code:
$ sudo freebsd-update install -F -b /usr/local/jail/base -d /usr/local/jail/base/var/db/freebsd-update
Installing updates...install: /usr/local/jail/base//usr/src/contrib/file/magic/Magdir/apache: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/file/magic/Magdir/bhl: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/file/magic/Magdir/gconv: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/file/magic/Magdir/gpu: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/file/magic/Magdir/webassembly: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/file/magic/Magdir/yara: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/file/tests/hddrawcopytool.result: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/ntp/sntp/m4/ntp_af_unspec.m4: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/ntp/sntp/tests/testconf.yml: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/tzdata/calendars: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/tzdata/theory.html: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/tzdata/ziguard.awk: No such file or directory
install: /usr/local/jail/base//usr/src/contrib/tzdata/zishrink.awk: No such file or directory
 done.

Why do I keep getting No such file or directory errors? Thanks!
 
Last edited by a moderator:
Okay, I resolved this problem by running git clone --depth=1 https://github.com/freebsd/freebsd.git and then re-tried and it worked!
I am sure I could use svnlite, but git is the future :)
 
Hi again! I am also playing with jails and I am not fully sure why that update wasn't working for you. But it may be that you have no /usr/local/jail/base/usr/src. Didn't you get the source through # make installworld and # make distribution?

When I update my jail I use chroot into the /jail/base dir and after that update as you would normally with freebsd-update. :)
 
The best way to do this is most definitely what michael_hackson suggested. In fact I strongly suggest that you don't use git for this!

Okay, I resolved this problem by running git clone --depth=1 https://github.com/freebsd/freebsd.git and then re-tried and it worked!
I think you basically broke your jail with this.

The first problem is that git will override everything, and several config files in /etc are part of the base system. So basically any local changes you made would get overwritten by system defaults and depending on your setup that can definitely not be a desirable result.

Another major problem is that the repository you used is 12-CURRENT, which is an unstable developer snapshot. You could have easily broke your jail with this; you can't expect software to run on CURRENT because, well, there aren't even any guarantees that it would run at all!

Looking at your freebsd-update command: you didn't have to specify -d, because you already told it to operate under a specific basedir. It's not a problem, but a lot of extra unneeded typing.

The error messages you got happened because you probably didn't have /usr/src installed. See, in order to use freebsd-update you have to configure it through /etc/freebsd-update.conf. In specific: you needed to set up a proper Components setting. If you don't have the source installed then don't tell freebsd-update to use it:
Code:
# Components of the base system which should be kept updated.
Components world

# Example for updating the userland and the kernel source code only:
# Components src/base src/sys world
This is the entry I use on my jail. See also freebsd-update.conf(5).

Bottom line: I think you may have to re-install your jail. Because running 12-CURRENT isn't the best of ideas here, especially if you value security and stability.
 
Back
Top