unable to do pkg update

Hallo

Thats happend after pkg update
Code:
pkg update   
Updating FreeBSD repository catalogue...
pkg: An error occured while fetching package
pkg: An error occured while fetching package
repository FreeBSD has no meta file, using default settings
pkg: An error occured while fetching package
pkg: An error occured while fetching package
pkg: An error occured while fetching package
pkg: An error occured while fetching package
Unable to update repository FreeBSD
Error updating repositories!

I have updatetd to

Code:
freebsd-version 
14.1-RELEASE-p3

What must I do, to get pkg work as it should?

regards
schwedenmann
 
First the bases. What is the output of:
freebsd-version -kru

You updated, you wrote, not upgraded, is it exact?

Is internet connectivity working?
 
Look like connection issue, can you run it in debug mode with pkg -d update

Also you can check if the curl is able to fetch the meta file with:

curl https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/meta.conf

If you want to verify if it's able to download the pkg list you can do it like this:
Code:
cd ~
curl https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/data.pkg --output data.pkg

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7156k  100 7156k    0     0  4731k      0  0:00:01  0:00:01 --:--:-- 4730k

Then you can remove the downloaded data.pkg from your home directory.
 
Hallo


Code:
 freebsd-version -kru
14.1-RELEASE-p3
14.1-RELEASE-p3
14.1-RELEASE-p3

Previously version was 13.2 I think

Code:
pkg -d update
DBG(1)[1035]> pkg initialized
Updating FreeBSD repository catalogue...
DBG(1)[1035]> PkgRepo: verifying update for FreeBSD
DBG(1)[1035]> Pkgrepo, begin update of '/var/db/pkg/repos/FreeBSD/db'
DBG(1)[1035]> Request to fetch pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf
DBG(1)[1035]> curl_open
DBG(1)[1035]> Fetch: fetcher used: pkg+https
DBG(1)[1035]> curl> fetching https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf

DBG(1)[1035]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Host pkgmir.geo.freebsd.org:443 was resolved.
* IPv6: 2604:1380:4091:a001::50:2
* IPv4: 147.28.184.43
*   Trying 147.28.184.43:443...
* Connected to pkgmir.geo.freebsd.org (147.28.184.43) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: certificate is not yet valid
* Closing connection
DBG(1)[1035]> CURL> attempting to fetch from , left retry 2


Code:
curl https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta.conf

curl: (60) SSL certificate problem: certificate is not yet valid
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the webpage mentioned above.



regards
schwedenmann
 
service ntpd stop
ntpdate 0.freebsd.pool.ntp.org
service ntpd start

If the cmos battery on your motherboard is low voltage it cannot hold the cmos clock and after you shutdown and power on the computer (power lost) it's clock will be not correct. When the time difference between your cmos clock is greater than 1000s offset ntpd will refuse to change it at its initial startup. To force it to make the correction bigger than 1000s you can use "-g" flag for the ntpd in your rc.conf ntpd_flags="-g" so it can change the clock at it startup. Other way is to disable the ntpd so it can free the port 123 (ntp)) and then manually set the time using ntpdate command.

ntpd(8)

note:
if you don't have network at the startup ntpd will fail to sync the time.
 
To force it to make the correction bigger than 1000s you can use "-g" flag for the ntpd in your rc.conf ntpd_flags="-g" so it can change the clock at it startup.
Slightly cleaner would be to set ntpd_sync_on_start="YES". No huge deal, but avoids accidentally clobbering the default args.
 
rc.conf(5)
Code:
       ntpd_sync_on_start
           (bool)  If  set  to "YES", ntpd(8) is run with the -g flag,
           which syncs the system's clock on startup.  See ntpd(8) for
           more    information regarding the -g option.  This is  a  pre-
           ferred  alternative    to  using ntpdate(8) or    specifying the
           ntpdate_enable variable.
 
Back
Top