Problems with Jails - Strange behaviour

Status
Not open for further replies.

eddi1984

Dabbler
Joined
Apr 3, 2015
Messages
42
Hi folks,

I have a problem with Jails (and maybe FreeNAS).

I have been trying to do this already on FreeNAS 9.3 and now on 9.10 with no success.

I am attempting to install qBitTorrent manually in a jail. There is a tutorial here in the forum that I am following. Unfortunately, I cannot use some basic commands, like:

Code:
pkg update
pkg upgrade
pkg install nano
portmaster


I tried pkg-static bootstrap -f and got this result:
Code:
root@Torrent:/ # pkg-static bootstrap -f
pkg(8) is already installed. Forcing reinstallation through pkg(7).
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/freebsd:9:x86:64/latest, please wait...
pkg-static: Warning: Major OS version upgrade detected.  Running "pkg-static install -f pkg" recommended
[Torrent] Installing pkg-1.7.1...
pkg-static: wrong architecture: FreeBSD:9:amd64 instead of FreeBSD:10:amd64
package pkg is already installed, forced install
[Torrent] Extracting pkg-1.7.1: 100%


Running uname -a in the jail gives me this:
Code:
root@Torrent:/ # uname -a
FreeBSD Torrent 10.3-RELEASE FreeBSD 10.3-RELEASE #0 52dd777(freebsd10): Fri Mar 25 14:48:36 PDT 2016     root@build.ixsystems.com:/tank/home/nightlies/build-freenas9/_BE/objs/tank/home/nightlies/build-freenas9/_BE/trueos/sys/FreeNAS.amd64  amd64


Running uname -a in FreeNAS I get this:
Code:
[root@freenas] /# uname -a
FreeBSD freenas.oldman.local 10.3-RELEASE FreeBSD 10.3-RELEASE #0 52dd777(freebsd10): Fri Mar 25 14:48:36 PDT 2016     root@build.ixsystems.com:/tank/home/nightlies/build-freenas9/_BE/objs/tank/home/nightlies/build-freenas9/_BE/trueos/sys/FreeNAS.amd64  amd64


I cannot install nano, I get this:
Code:
[root@freenas] /# pkg install nano
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The most recent version of packages are already installed


EDIT:
Here is the pkg repo:
Code:
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:9:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}

/EDIT


Running the above suggested pkg-static install -f pkg has this result:
Code:
[root@freenas] /# pkg-static install -f pkg
Updating local repository catalogue...
pkg-static: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg-static: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
All repositories are up-to-date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        pkg-1.6.2

4 MiB to be downloaded.

Proceed with this action? [y/N]: y
Checking integrity... done (0 conflicting)
pkg-static: archive_read_open_filename(/usr/ports/packages/All/pkg-1.6.2.txz): Failed to open '/usr/ports/packages/All/pkg-1.6.2.txz'


Basically nothing is working. I cannot use pkg, portmaster etc. I cannot install anything or use the jail in any meaningful way. How can I fix this?

One more thought. I thought that FreeNAS is actually running on FreeBSD 9.x, however, uname shows that it is FreeBSD 10.x ... strange.

Lastly, my current freeNAS version:
Code:
Current Train: FreeNAS-9.10-STABLE (Installed OS)


Hope somebody can help.

Thanks.
 
Last edited:

eddi1984

Dabbler
Joined
Apr 3, 2015
Messages
42
Hi,

I was able to fix it. I had to edit the FreeBSD.conf in /usr/local/etc/pkg/repos.

Problem was, that it was referring to version 9 repo, so I changed it to 10.

Basically going from this:
Code:
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:9:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}


to this:
Code:
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}


After that I used these commands to fix pkg again, and than use pkg to update, upgrade and install stuff:
Code:
portsnap fetch
portsnap extract
portsnap fetch update

cd /usr/ports/ports-mgmt/pkg
make
make reinstall


Rebuilding the ports list was probably not necessary, however, I just wanted to make sure.

This fixed pkg for me.

Hope this helps somebody else out there.

Cheers,

Eddi
 

mccann73

Dabbler
Joined
Dec 11, 2013
Messages
41
Status
Not open for further replies.
Top