Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pkgng cannot fetch from PACKAGESITE with nanobsd.sh in FreeBSD 10.1

126 views
Skip to first unread message

Zenny

unread,
Apr 1, 2015, 6:48:32 AM4/1/15
to
Hi,

1. In order to comply with the pkgng in FreeBSD 10.1, the following changes
were appended to my customized nanobsd.conf:

customize_cmd cust_NANOBSD_setup
>
> cust_NANOBSD_packages() {
> chroot ${NANO_WORLDDIR} sh -c 'cd packages; pkg; pkg install nano; pkg
> clean;'
> }
>
> customize_cmd cust_NANOBSD_packages
>

Certainly I had tuned chrooted /etc/resolv.conf with:

#tune resolv.conf
> echo '
> nameserver 8.8.8.8
> nameserver 8.8.4.4
> ' >> ${NANO_WORLDDIR}/etc/resolv.conf
>

Still the package cannot be downloaded from PACKAGESITE and got built into
nanobsd image.

2. Also tried with:

cust_pkg() {
> pkg -c ${NANO_WORLDDIR} update
> pkg -c ${NANO_WORLDDIR} install nano
> pkg -c ${NANO_WORLDDIR} clean
> }
>
> customize_cmd cust_pkg
>

Both ways, I get the same error that reads as of below:

cd: packages: No such file or directory
> pkg: Error fetching
> http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/Latest/pkg.txz: No
> address record
> A pre-built version of pkg could not be found for your system.
> Consider changing PACKAGESITE or installing it from ports:
> 'ports-mgmt/pkg'.
> The package management tool is not yet installed on your system.
> Do you want to fetch and install it now? [y/N]: Bootstrapping pkg from pkg+
> http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait...
> pkg: Error fetching
> http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/Latest/pkg.txz: No
> address record
> A pre-built version of pkg could not be found for your system.
> Consider changing PACKAGESITE or installing it from ports:
> 'ports-mgmt/pkg'.
> The package management tool is not yet installed on your system.
> Do you want to fetch and install it now? [y/N]: Bootstrapping pkg from pkg+
> http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait...
> pkg: Error fetching
> http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/Latest/pkg.txz: No
> address record
> A pre-built version of pkg could not be found for your system.
> Consider changing PACKAGESITE or installing it from ports:
> 'ports-mgmt/pkg'.
> The package management tool is not yet installed on your system.
> Do you want to fetch and install it now? [y/N]: Bootstrapping pkg from pkg+
> http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait...
>

Any hint on how to get over to this problem. Thanks!

/z
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stabl...@freebsd.org"

Zenny

unread,
Apr 2, 2015, 8:48:08 AM4/2/15
to
bump!

Baptiste Daroussin

unread,
Apr 2, 2015, 2:39:56 PM4/2/15
to
On Wed, Apr 01, 2015 at 12:48:21PM +0200, Zenny wrote:
> Hi,
>
> 1. In order to comply with the pkgng in FreeBSD 10.1, the following changes
> were appended to my customized nanobsd.conf:
>
> customize_cmd cust_NANOBSD_setup
> >
> > cust_NANOBSD_packages() {
> > chroot ${NANO_WORLDDIR} sh -c 'cd packages; pkg; pkg install nano; pkg
> > clean;'
> > }
> >
> > customize_cmd cust_NANOBSD_packages
> >
>
> Certainly I had tuned chrooted /etc/resolv.conf with:
>
> #tune resolv.conf
> > echo '
> > nameserver 8.8.8.8
> > nameserver 8.8.4.4
> > ' >> ${NANO_WORLDDIR}/etc/resolv.conf
> >

This tuning is not needed you can specify the nameserver on pkg command line:
pkg -o NAMESERVER="8.8.8.8" -c ${NANO_WORLDDIR} update

You can also simply add NAMESERVER in your environement variable
Is pkg installed on your host? it seems not?

Best regards,
Bapt

Zenny

unread,
Apr 2, 2015, 7:33:30 PM4/2/15
to
On 4/2/15, Baptiste Daroussin <ba...@freebsd.org> wrote:
> On Wed, Apr 01, 2015 at 12:48:21PM +0200, Zenny wrote:
>> Hi,
>>
>> 1. In order to comply with the pkgng in FreeBSD 10.1, the following
>> changes
>> were appended to my customized nanobsd.conf:
>>
>> customize_cmd cust_NANOBSD_setup
>> >
>> > cust_NANOBSD_packages() {
>> > chroot ${NANO_WORLDDIR} sh -c 'cd packages; pkg; pkg install nano; pkg
>> > clean;'
>> > }
>> >
>> > customize_cmd cust_NANOBSD_packages
>> >
>>
>> Certainly I had tuned chrooted /etc/resolv.conf with:
>>
>> #tune resolv.conf
>> > echo '
>> > nameserver 8.8.8.8
>> > nameserver 8.8.4.4
>> > ' >> ${NANO_WORLDDIR}/etc/resolv.conf
>> >
>
> This tuning is not needed you can specify the nameserver on pkg command
> line:
> pkg -o NAMESERVER="8.8.8.8" -c ${NANO_WORLDDIR} update
>
> You can also simply add NAMESERVER in your environement variable

Thanks for the pointer, I shall try.
It does.

#which pkg
/usr/sbin/pkg
#pkg -v
1.4.12

>
> Best regards,
> Bapt

Brandon Allbery

unread,
Apr 4, 2015, 8:33:52 PM4/4/15
to
On Sat, Apr 4, 2015 at 8:26 PM, Zenny <garby...@gmail.com> wrote:

> + cust_NANOBSD_packages
> + env SSL_NO_VERIFY_HOSTNAME=true env SSL_NO_VERIFY_PPER=true pkg -c
> install -fy nano
> pkg: illegal option -- f
> pkg: illegal option -- y
> pkg: chroot failed!
>
> When I install with -y flag on the host node, it works fine, but
> causing problem only in the chrooted environment. Where did I get
> wrong? Thanks in advance.
>

Notice that ${NANO_WORLDDIR} didn't substitute anything; it used "install"
as the chroot (which is why it failed) and -fy as global options instead of
options to the "install" command it didn't see because -c ate it.

--
brandon s allbery kf8nh sine nomine associates
allb...@gmail.com ball...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Zenny

unread,
Apr 4, 2015, 9:01:07 PM4/4/15
to
Thanks Brandon.

Yes, I did notice a typo. Missed a 'D' in NANO_WORLDDIR:
pkg -c ${NANO_WORLDIR} install -fy ${PACKAGELIST}

/z

Zenny

unread,
Apr 4, 2015, 9:20:35 PM4/4/15
to
On 4/5/15, Zenny <garby...@gmail.com> wrote:
> Thanks Brandon.
>
> Yes, I did notice a typo. Missed a 'D' in NANO_WORLDDIR:
> pkg -c ${NANO_WORLDIR} install -fy ${PACKAGELIST}

The above asked to do a 'pkg update', so accordingly, I added to
custom_packages the following:

cust_NANOBSD_packages() {
env SSL_NO_VERIFY_HOSTNAME="true" \
env SSL_NO_VERIFY_PPER="true" \
pkg -c ${NANO_WORLDDIR} -f update
env SSL_NO_VERIFY_HOSTNAME="true" \
env SSL_NO_VERIFY_PPER="true" \
pkg -c ${NANO_WORLDDIR} install -y ${PACKAGELIST}
env SSL_NO_VERIFY_HOSTNAME="true" \
SSL_NO_VERIFY_PEER="true" \
pkg -c ${NANO_WORLDDIR} clean -a -y
rm -f ${NANO_WORLDDIR}/var/db/pkg/repo-*.sqlite
}

But it fails with:

+ env SSL_NO_VERIFY_HOSTNAME=true env SSL_NO_VERIFY_PPER=true pkg -c
/usr/obj/nanobsd.NANOBSD-PFS//_.w -f update
pkg: illegal option -- f
Updating FreeBSD repository catalogue...
pkg: http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest/meta.txz: No address record
pkg: repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest/packagesite.txz:
No address record
pkg: Unable to update repository FreeBSD

hmmmm....

Zenny

unread,
Apr 4, 2015, 9:35:07 PM4/4/15
to
On 4/5/15, Zenny <garby...@gmail.com> wrote:
> On 4/5/15, Zenny <garby...@gmail.com> wrote:
>> Thanks Brandon.
>>
>> Yes, I did notice a typo. Missed a 'D' in NANO_WORLDDIR:
>> pkg -c ${NANO_WORLDIR} install -fy ${PACKAGELIST}
>
> The above asked to do a 'pkg update', so accordingly, I added to
> custom_packages the following:
>
> cust_NANOBSD_packages() {
> env SSL_NO_VERIFY_HOSTNAME="true" \
> env SSL_NO_VERIFY_PPER="true" \
> pkg -c ${NANO_WORLDDIR} -f update
> env SSL_NO_VERIFY_HOSTNAME="true" \
> env SSL_NO_VERIFY_PPER="true" \
> pkg -c ${NANO_WORLDDIR} install -y ${PACKAGELIST}
> env SSL_NO_VERIFY_HOSTNAME="true" \
> SSL_NO_VERIFY_PEER="true" \
> pkg -c ${NANO_WORLDDIR} clean -a -y
> rm -f ${NANO_WORLDDIR}/var/db/pkg/repo-*.sqlite
> }

It worked when I copied the /etc/resolv.conf to the ${NANO_WORLDDIR}.

cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/
0 new messages