pkg problem re-visited

Hi there
searching the internet I gathered that my problem was solved more than once and also fixed 'lately'. Still I ran into it and stuck.
on a freshly installed freeBSD 14.2 (GENERIC amd64) I dutifully follow the Handbook (p.135)
# mkdir -p /usr/local/etc/pkg/repos
# echo 'FreeBSD: { url: "pkg+http://pkg.freebsd./usr/local/etc/pkg/repos/FreeBSD.conf
# pkg update -f
here comes Oops! --
pkg: No SRV record found for the repo 'FreeBSD'
the threads
https://forums.freebsd.org/threads/problems-with-pkg-1-20-8.90655/
https://forums.freebsd.org/threads/pkg-no-srv-record-found-for-the-repo-freebsd.90716/
suggested improving .../repos/FreeBSD.conf by deleting "pkg+" and incerting 'mirror_type: "none"'
which I did and got "Unable to update... Error updating repositories"
and here am I scratching the back of my head puzzledly, and waiting, hat in hand, for you kind help
 
Code:
# mkdir -p /usr/local/etc/pkg/repos
# echo 'FreeBSD: { url: "pkg+http://pkg.freebsd./usr/local/etc/pkg/repos/FreeBSD.conf
If you exactly typed it like:
echo 'FreeBSD: { url: "pkg+http://pkg.freebsd./usr/local/etc/pkg/repos/FreeBSD.conf
you are missing something.

If you want to use the latest repository, it should be (as root):
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' > /usr/local/etc/pkg/repos/FreeBSD.conf

Check the contents of the file /usr/local/etc/pkg/repos/FreeBSD.conf, it should look like:
Code:
% cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
    url: pkg+https://pkg.freebsd.org/${ABI}/latest,
}

Also verify the following output of pkg -vv | sed -n '/^Repositories:/,$ p', it should look like this:
Code:
 % pkg -vv | sed -n '/^Repositories:/,$ p'
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
 
you are missing something.
thank you for coming to help
yes, I was tinkering after the threads in the forums.
now the situation is as follows:
Code:
root@freebsd:/usr/local/etc/repos # cat FreeBSD.conf
FreeBSD: { url: "pkg+http://pkg.freebsd.org/${ABI}/latest" }
Code:
root@freebsd:/usr/local/etc/repos # pkg -vv|sed -n '/^Repositories:/,$ p'
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
Code:
root@freebsd:/usr/local/etc/repos # pkg update -f
Updating FreeBSD repository  catalogue...

pkg: No SRV record found for the repo 'FreeBSD
pkg: packagesite URL error for pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest/meta.txz -- pkg+:// implies SRV mirror type
repository FreeBSD has no meta file, using defauult settings
Unable to update repository FreeBSD
Error updating repositories!
 
Last edited by a moderator:
Did you muck around with /etc/pkg/FreeBSD.conf?

And where are you getting your DNS from?

mirror_type: "SRV" and pkg+https://pkg.FreeBSD.org/.... should work fine:
Code:
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
 
Did you muck around with /etc/pkg/FreeBSD.conf?

And where are you getting your DNS from?
yes, I did muck with it and confessed that in OP but then I reformed and restored to:
Code:
FreeBSD: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

and I'm getting my DNS from my Samsung phone
the command you suggested brought about:
Code:
 -sh: mirror_type:: not found
  -sh: pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest: not found
  [1] Done(127)
 
Hi there.
Well, not for me. I was happy finding this thread, and so recent, but I have the same problem.


I am running into trouble updating the repository catalogue, with "pkg update -f". The err msg simply says "An error occured while fetching package" and then there is a line saying "repository FreeBSD has no meta file, using default settings".

There is also a variation of the err msg:
pkg: No SRV record found for the repo 'FreeBSD'
as described by previous post.

I've browsed the forum and found some suggestions - setting time, with ntpd and installing ca_root_nss. I have run ntpd and I have a ports build of ca_root_nss but it has not solved the problem.

freebsd-version -ru: 14.2-RELEASE-p3.

Curious though, without the net interface up the errors are the same, but when the net interface is up there is a short lag before the program returns with err.
Any suggestions would be welcome
 
Here i encountered other error.
I have two virtual servers running 14.3. One was fresh install and other one was upgraded from 14.2(this has error explained below).

On upgraded 14.3 server
pkg -vv | sed -n '/^Repositories:/,$ p'
Code:
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-kmods: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0
  }

On fresh box:
pkg -vv | sed -n '/^Repositories:/,$ p'
Code:
Repositories:
  FreeBSD: {
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-kmods: {
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

Both boxes has same configuration:
/etc/resolv.conf
Code:
nameserver 8.8.8.8
/etc/pkg/FreeBSD.conf
Code:
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-kmods: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
/usr/local/etc/pkg/repos/latest.conf
Code:
FreeBSD: {
    url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
FreeBSD-kmods: {
    url: "pkg+http://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}"
}

On one box there is problem with pkg update
Code:
pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   10 MiB   2.6MB/s    00:04
Processing entries: 100%
FreeBSD repository update completed. 35990 packages processed.
Updating FreeBSD-kmods repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   16 KiB  16.7kB/s    00:01
Processing entries: 100%
FreeBSD-kmods repository update completed. 53 packages processed.
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/meta.conf -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/meta.txz -- pkg+:// implies SRV mirror type
repository FreeBSD has no meta file, using default settings
pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/data.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/data.tzst -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/packagesite.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest/packagesite.tzst -- pkg+:// implies SRV mirror type
Unable to update repository FreeBSD
Error updating repositories!

Other box is working just fine.

Problem disappear when i remove latest.conf, and replace quarterly with latest in /etc/pkg/FreeBSD.org.
 
Compare the md5 of /usr/local/etc/pkg/repos/latest.conf on between these servers.

Thank you for suggestion.
This was 'invisible' character on first line which I didn't seen in vim, but noticed in mcedit.
Copy/paste in putty is not perfect.
 
It looks like there still might be something wrong.


Could you again post the output of pkg -vv | sed -n '/^Repositories:/,$ p' on this 'upgraded 14.3 server' ?
Here you go
Code:
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-kmods: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

After I removed 'invidible' character that was in front of "FreeBSD" repository, now all is fine.
Where was two repos, but one was with wrong name that I didnt catch at first.
 
Right. Then using
/usr/local/etc/pkg/repos/latest.conf
Code:
FreeBSD: { 
     url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" 
} 
FreeBSD-kmods: { 
     url: "pkg+http://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}" 
}
works as intended.

I'm not quite sure why you are using url: "pkg+http: instead of url: "pkg+https:.
Also because, for the upgraded server, you have it working with the https scheme.
 
Right. Then using

works as intended.

I'm not quite sure why you are using url: "pkg+http: instead of url: "pkg+http[B]s[/B]:.
Also because, for the upgraded server, you have it working with the https scheme.
Well, most likely i had https in there, but i was changing it few times before i could find what was actual cause.
Now im using pkg+https on both, and its working as intended.
 
Back
Top