Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 May 2014 16:46:45 -0400
From:      Fbsd8 <fbsd8@a1poweruser.com>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        pkg@freebsd.org
Subject:   Re: bootstrapping /usr/sbin/pkg inside a jail
Message-ID:  <536A9BB5.9080905@a1poweruser.com>
In-Reply-To: <CAG=rPVfqUFGm0-_pogHfZM5OcPCxO2hWEc5rSgkzCfmUgV72gw@mail.gmail.com>
References:  <5369407E.9060008@a1poweruser.com>	<53694241.6050207@my.hennepintech.edu>	<536A3E10.4030902@a1poweruser.com> <CAG=rPVfqUFGm0-_pogHfZM5OcPCxO2hWEc5rSgkzCfmUgV72gw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Rodrigues wrote:
> On Wed, May 7, 2014 at 7:07 AM, Fbsd8 <fbsd8@a1poweruser.com> wrote:
>> jexec dir23 tcsh
>> dir23 /root >/usr/sbin/pkg
>> 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
>> ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-current/Latest/,
>> please wait...
>> pkg: Error fetching
>> ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-current/Latest//Latest/pkg.txz:
>> File unavailable (e.g., file not found, no access)
>> A pre-built version of pkg could not be found for your system.
>> Consider changing PACKAGESITE or installing it from ports
> 
> Hi,
> 
> I encountered similar problems when moving the build system of FreeNAS to use
> poudriere for building ports.
> You might want to check out:
> 
> https://github.com/freenas/freenas/blob/master/build/ports/install-ports.sh#L29
> 
> If you play with the PACKAGESITE environment variable,
> and create the following files inside your jail:
> /usr/local/etc/pkg/repos/FreeBSD.conf
> /usr/local/etc/pkg/repos/local.conf
> 
> with entries like how I did in the install-ports.sh script, you can
> suppress that
> error message from /usr/sbin/pkg.
> 
> --
> Craig
> 
Thank you Craig for your work around. But the fact is the bootstrap pkg 
program should work from within a jail. This looks like a bug that needs 
a PR.

My work around was to move my host's ports tree to the jail, then "jexec 
dir23 tcsh" into the jail and do "a "make install clean" on pkg. This 
did install pkg in the jail. here is the log.

 From the host
/ >echo $PACKAGESITE
PACKAGESITE: Undefined variable.

 From the jail, pkg not installed yet
dir23 /root >echo $PACKAGESITE
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-current/Latest/


 From with in the jail here is the ending of the pkg make install of the 
port.
====> Compressing man pages (compress-man)
===>  Installing for pkg-1.2.7_2
===>  Checking if ports-mgmt/pkg already installed
pkg-static: PACKAGESITE in pkg.conf is deprecated. Please create a 
repository configuration file
===>   Registering installation for pkg-1.2.7_2
pkg-static: PACKAGESITE in pkg.conf is deprecated. Please create a 
repository configuration file
Installing pkg-1.2.7_2... done
If you are upgrading from the old package format, first run:

   # pkg2ng



dir23 /etc >pkg install ytree
pkg: PACKAGESITE in pkg.conf is deprecated. Please create a repository 
configura
tion file
Updating repository catalogue
pkg: Warning: use of ftp:// URL scheme with SRV records is deprecated: 
switch to
  pkg+ftp://
pkg: 
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-current/Latest//diges
ts.txz: File unavailable (e.g., file not found, no access)
pkg: Unable to find catalogs

Here I exited the jail, stopped it and restarted it and re-issued the 
same pkg command and this time it worked

dir23 /etc >pkg install ytree
pkg: PACKAGESITE in pkg.conf is deprecated. Please create a repository 
configuration file
Updating repository catalogue
digests.txz                         100% 1074KB 357.9KB/s 493.6KB/s   00:03
packagesite.txz                     100% 4936KB 448.7KB/s 646.0KB/s   00:11
Incremental update completed, 22978 packages processed:
0 packages updated, 0 removed and 22978 added.
digests.txz                         100% 1074KB 536.8KB/s 253.6KB/s   00:02
packagesite.txz                     100% 4936KB 448.7KB/s 466.0KB/s   00:11
Incremental update completed, 22978 packages processed:
0 packages updated, 0 removed and 22978 added.
The following 1 packages will be installed:

         Installing ytree: 1.97 [FreeBSD]

The installation will require 223 KB more space

68 KB to be downloaded

Proceed with installing packages [y/N]: y
ytree-1.97.txz                      100%   68KB  68.0KB/s  68.0KB/s   00:00
Checking integrity... done
[1/1] Installing ytree-1.97... done

In another jail that I had not compiled the pkg port in I tried a 
different method. After starting the jail, from the host I issued this
pkg -j dir20 install pkg
it processed like it was installing pkg in the jail, but after entering 
the jail and doing pkg install ytree I get this message

pkg: PACKAGESITE in pkg.conf is deprecated. Please create a repository 
configuration file and it tries to download the package from a invalid 
ftp site url.







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?536A9BB5.9080905>