Can't install bash in Jail

Status
Not open for further replies.
Joined
Mar 25, 2016
Messages
4
I'm stuck. I just installed freenas and I'm following this walkthrough to setup a VPN. However I can't seem to install any packages in the jail. What am I doing wrong?
_______________________________________________________________________
root@openvpn:~ # pkg install bash
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: No packages available to install matching 'bash' have been found in the rep
ositories
root@openvpn:~ # bash
bash: Command not found.
 
Joined
Mar 25, 2016
Messages
4
Have you updated the repository first?

# pkg update

I did. Looking at it again I believe that I need to be in transmission on the command line in order to be able to download anything as i am currently @FreeNAS not transmission. Not sure how that's done yet, but I'm going to try to figure it out. Sorry super huge n00b

______________________

Quick edit here. I started transmission went into the transmission jail tried to download with no luck.
 
Last edited:
Joined
Mar 25, 2016
Messages
4
Have you tried searching for it?

# pkg search bash
Here is the result:
[root@freenas ~]# pkg search bash
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
bash-4.3.42_1 The GNU Project's Bourne Again SHell
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Why are you attempting to install a package on the base system? You need to run 'pkg install bash' within a jail.
 
Joined
Mar 25, 2016
Messages
4
Why are you attempting to install a package on the base system? You need to run 'pkg install bash' within a jail.


Sorry my mistake. meant to search in jail named "openvpn" . Nothing happens when I search in that jail:

root@openvpn:/ # pkg search bash
root@openvpn:/ #
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Did you update the repository in the jail? Remember, the jail is a completely separate userland.
 

Fredde

Explorer
Joined
Dec 7, 2015
Messages
58
i have the same problem.

Code:
root@ovpn:/ # pkg update
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
root@ovpn:/ # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
root@ovpn:/ # pkg install bash
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: No packages available to install matching 'bash' have been found in the repositories
root@ovpn:/ #


this is a fresh jail with 9.10 template and this is not only affecting "bash", no packages cant be installed or i can do a search after them...

Code:
root@ovpn:/ # uname -a
FreeBSD ovpn 10.3-RC3 FreeBSD 10.3-RC3 #0 86b9b91(freebsd10): Mon Mar 21 17:43:20 PDT 2016     root@build.ixsystems.com:/tank/home/nightlies/build-freenas9/_BE/objs/tank/home/nightlies/build-freenas9/_BE/trueos/sys/FreeNAS.amd64  amd64
root@ovpn:/ #



Update:

I deleted the jail, and typed pkg update/upgrade again and now i got this

Code:
pkg: wrong architecture: freebsd:9:x86:64 instead of FreeBSD:10:amd64
pkg: repository FreeBSD contains packages with wrong ABI: freebsd:9:x86:64


i think im gonna rollback to 9.3-stable again if this isnt a easy fix
 
Last edited:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
  • pkg: wrong architecture: freebsd:9:x86:64 instead of FreeBSD:10:amd64
  • pkg: repository FreeBSD contains packages with wrong ABI: freebsd:9:x86:64
Ah, so you upgraded from 9.3 to 9.10. Here's a little note that came with in the 9.10 announcement:

A note on jails for 9.10: As you will see in the release notes, the FreeNAS jail templates have also been updated to FreeBSD 10.3. Due to the way templates are cached, however, anyone currently using jails (including plugins) will continue to use the cached (already fetched) 9.3 jail templates. This is not really a problem since FreeBSD 10 is backwards compatible with 9.3 and all existing plugins and jails should continue to function normally after the upgrade, but should you create any new jails or plugins, you may be surprised to note that they're also using the 9.3 templates. This is a limitation of the jails architecture in FreeNAS which is being addressed differently in 10, and for now the only way around this is, unfortunately, to nuke your jails dataset completely (to delete all cached templates) along with any jails in it, and start over with a new jails dataset.

http://lists.freenas.org/pipermail/freenas-announce/2016-March/000028.html

tl;dr: You have to re-create your jail root.
 

Fredde

Explorer
Joined
Dec 7, 2015
Messages
58
Ah, so you upgraded from 9.3 to 9.10. Here's a little note that came with in the 9.10 announcement:



http://lists.freenas.org/pipermail/freenas-announce/2016-March/000028.html

tl;dr: You have to re-create your jail root.


Okey thanks for the info m0kney_!

But i edited /usr/local/etc/pkg/repos/FreeBSD.conf i changed "freebsd:9:x86:64" to "freebsd:10:x86:64", restarted the jail, and now it works, i dont know if this "fix" is 100% sure to use, but it works for my test jail, im not having plans to install other jails in the near future so i will keep them the way they are.. Until i have backuped my jails and do what you said, re-create the jail dataset!
 
Joined
Dec 2, 2015
Messages
730
I also upgraded from FN 9.3.1 to 9.10. My original jails still work, and pkg update, pkg upgrade and other pkg commands work for me.

Code:
misc# pkg update
Updating FreeBSD repository catalogue...
[misc] Fetching meta.txz: 100%    968 B   1.0kB/s    00:01
[misc] Fetching packagesite.txz: 100%    5 MiB 929.3kB/s    00:06
Processing entries: 100%
FreeBSD repository update completed. 24796 packages processed.

misc# pkg install bash
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    bash: 4.3.42_1

The process will require 6 MiB more space.
1 MiB to be downloaded.

Proceed with this action? [y/N]:


There must be something else going on, but I have no idea what.
 
Status
Not open for further replies.
Top