Pkg static repository freebsd load error meta cannot be loaded no error 0

Hi all, I'm getting the following error on my FreeBSD 12.1-RELEASE-p2: # pkg update Updating FreeBSD_latest repository catalogue... pkg: repository meta has wrong version 2 pkg: Repository FreeBSD_latest load error: meta cannot be loaded No error: 0 Fetching meta.txz: 100% 916 B 0.9kB/s...

  • #1

Hi all,

I’m getting the following error on my FreeBSD 12.1-RELEASE-p2:

Code:

# pkg update
Updating FreeBSD_latest repository catalogue...
pkg: repository meta has wrong version 2
pkg: Repository FreeBSD_latest load error: meta cannot be loaded No error: 0
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01
pkg: repository meta has wrong version 2
repository FreeBSD_latest has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB   1.1MB/s    00:06
pkg: repository meta has wrong version 2
pkg: Repository FreeBSD_latest load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD_latest
Unable to update repository FreeBSD_latest
Error updating repositories!

This is my pkg config:

Code:

# pkg -vv
Version                 : 1.11.1
PKG_DBDIR = "/var/db/pkg";
PKG_CACHEDIR = "/var/cache/pkg";
PORTSDIR = "/usr/ports";
INDEXDIR = "";
INDEXFILE = "INDEX-12";
HANDLE_RC_SCRIPTS = false;
DEFAULT_ALWAYS_YES = false;
ASSUME_ALWAYS_YES = false;
REPOS_DIR [
    "/etc/pkg/",
    "/usr/local/etc/pkg/repos/",
]
PLIST_KEYWORDS_DIR = "";
SYSLOG = true;
ABI = "FreeBSD:12:amd64";
ALTABI = "freebsd:12:x86:64";
DEVELOPER_MODE = false;
VULNXML_SITE = "http://vuxml.freebsd.org/freebsd/vuln.xml.bz2";
FETCH_RETRY = 3;
PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [
]
DEBUG_SCRIPTS = false;
PLUGINS_CONF_DIR = "/usr/local/etc/pkg/";
PERMISSIVE = false;
REPO_AUTOUPDATE = true;
NAMESERVER = "";
HTTP_USER_AGENT = "pkg/1.11.1";
EVENT_PIPE = "";
FETCH_TIMEOUT = 30;
UNSET_TIMESTAMP = false;
SSH_RESTRICT_DIR = "";
PKG_ENV {
}
PKG_SSH_ARGS = "";
DEBUG_LEVEL = 0;
ALIAS {
    all-depends = "query %dn-%dv";
    annotations = "info -A";
    build-depends = "info -qd";
    cinfo = "info -Cx";
    comment = "query -i "%c"";
    csearch = "search -Cx";
    desc = "query -i "%e"";
    download = "fetch";
    iinfo = "info -ix";
    isearch = "search -ix";
    prime-list = "query -e '%a = 0' '%n'";
    prime-origins = "query -e '%a = 0' '%o'";
    leaf = "query -e '%#r == 0' '%n-%v'";
    list = "info -ql";
    noauto = "query -e '%a == 0' '%n-%v'";
    options = "query -i "%n - %Ok: %Ov"";
    origin = "info -qo";
    provided-depends = "info -qb";
    rall-depends = "rquery %dn-%dv";
    raw = "info -R";
    rcomment = "rquery -i "%c"";
    rdesc = "rquery -i "%e"";
    required-depends = "info -qr";
    roptions = "rquery -i "%n - %Ok: %Ov"";
    shared-depends = "info -qB";
    show = "info -f -k";
    size = "info -sq";
}
CUDF_SOLVER = "";
SAT_SOLVER = "";
RUN_SCRIPTS = true;
CASE_SENSITIVE_MATCH = false;
LOCK_WAIT = 1;
LOCK_RETRIES = 5;
SQLITE_PROFILE = false;
WORKERS_COUNT = 0;
READ_LOCK = false;
PLIST_ACCEPT_DIRECTORIES = false;
IP_VERSION = 0;
AUTOMERGE = true;
VERSION_SOURCE = "";
CONSERVATIVE_UPGRADE = true;
PKG_CREATE_VERBOSE = false;
AUTOCLEAN = false;
DOT_FILE = "";
REPOSITORIES {
}
VALID_URL_SCHEME [
    "pkg+http",
    "pkg+https",
    "https",
    "http",
    "file",
    "ssh",
    "ftp",
    "ftps",
    "pkg+ssh",
    "pkg+ftp",
    "pkg+ftps",
]
ALLOW_BASE_SHLIBS = false;
WARN_SIZE_LIMIT = 1048576;
METALOG = "";
OSVERSION = 1201000;
IGNORE_OSVERSION = false;


Repositories:
  FreeBSD_latest: {
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

Any thoughts on what might cause the issue?

Thanks!

  • #2

Repositories: FreeBSD_latest: { url : «pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest», enabled : yes, priority : 0, mirror_type : «SRV», signature_type : «FINGERPRINTS», fingerprints : «/usr/share/keys/pkg» }

Can you keep this shorter? Mirror_type might not be always necessary; so also pkg+http in URL. You could look up the *Internet for sample conf files.

  • Thread Starter

  • #3

This is my

/usr/local/etc/pkg/repos/FreeBSD.conf

:

Code:

FreeBSD: { enabled: no }
FreeBSD_latest: {
   url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
   mirror_type: "srv",
   signature_type: "fingerprints",
   fingerprints: "/usr/share/keys/pkg",
   enabled: yes
}

I would add that I’ve had the same setup for quite some time and it only recently broke.

Removing the pkg+http scheme results in a deprecation warning.

Even a bare-minimum .conf like so:

Code:

FreeBSD_latest: {
   url: "http://pkg.FreeBSD.org/${ABI}/latest",
}

Results in:

Code:

# pkg update
Updating FreeBSD repository catalogue...
pkg: repository meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Warning: use of http:// URL scheme with SRV records is deprecated: switch to pkg+http://
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01
pkg: repository meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Warning: use of http:// URL scheme with SRV records is deprecated: switch to pkg+http://
Fetching packagesite.txz: 100%    6 MiB 461.8kB/s    00:14
pkg: repository meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!

At any rate, I don’t think the problem is with the mirror or the connection, but rather with my local database.

SirDice


  • #4

Try this first: pkg-static install -f pkg. Then follow up with pkg update -f.

  • Thread Starter

  • #5

Code:

# pkg-static install -f pkg
Updating FreeBSD repository catalogue...
pkg-static: repository meta has wrong version 2
pkg-static: Repository FreeBSD load error: meta cannot be loaded No error: 0
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01
pkg-static: repository meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB   1.1MB/s    00:06
pkg-static: repository meta has wrong version 2
pkg-static: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!

Looks like there is something wrong with the DB.
I remember reading that automatic backups of the DB are being performed, perhaps it’s worth investigating that?

SirDice


  • #6

I remember reading that automatic backups of the DB are being performed, perhaps it’s worth investigating that?

I don’t think your local registration database is at fault, it only complains about the meta data and SQL from the locally cached remote repositories. Try removing

/var/db/pkg/FreeBSD.meta

,

/var/db/pkg/FreeBSD_latest.meta

,

/var/db/pkg/repo-FreeBSD.sqlite

and

/var/db/pkg/repo-FreeBSD_latest.sqlite

. Then running pkg update again.

Do NOT remove

/var/db/pkg/local.sqlite

(it contains the registrations for your currently installed packages). In case you still want to checkout the backups, they’re in

/var/backups/

.

  • Thread Starter

  • #7

Thanks for your suggestions.

Unfortunately it sill gives the same «wrong version 2» error as before:

Code:

# rm /var/db/pkg/FreeBSD.meta
# rm /var/db/pkg/FreeBSD_latest.meta
# rm /var/db/pkg/repo-FreeBSD.sqlite
# rm /var/db/pkg/
local.sqlite  vuln.xml
# pkg update
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01
pkg: repository meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB   1.1MB/s    00:06
pkg: repository meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!

  • #8

Try updating

ports-mgmt/pkg

from the ports tree using

ports-mgmt/portmaster

.
If you haven’t fetched the ports tree yet, just do the following:

Code:

# portsnap fetch
# portsnap extract

Once the process is over, assuming you have

ports-mgmt/portmaster

installed already, run:

At the end, you should see pkg version 1.13.2 installed (at the time of writing this post)

After I did the above, I got this:

Code:

# pkg upgrade -F
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (3 candidates): 100%
Processing candidates (3 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

  • Thread Starter

  • #9

  • #10

I have the same problem. The two portsnap commands worked, but I’m blocked on the «portmaster pkg» step as it is not installed, and «pkg install portmaster» also produces a «wrong version 2» error. Any ideas?

  • #11

If you are using ports (your mention of

portsnap

…), what happens if you try to build pkg from ports manually?
like this:

Code:

cd /usr/ports/ports-mgmt/pkg
make install clean
cd

  • #13

Thanks for your replies. I can see how that likely would have worked.

Yesterday I continued playing with it and decided to upgrade since I was running an unsupported release (11.0). At some point in the process of moving to 12.1 I wound up with a new enough version of pkg that I was able to overcome the issue using the technique above. And now my server is up to date. :)

The upgrade went smoothly with no disruption to my local configurations — kudos to the FreeBSD team!

  • #14

I’ve been running into this with 12.0-RELEASE to 12.1-RELEASE and

freebsd-update

After a lot of frustration, I’ve had some success with (using the repo of your architecture and quarterly/latest choice)

Code:

fetch https://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/pkg-1.14.2.txz
sudo pkg add -f pkg-1.14.2.txz

pkg-add(8) suggests that

Code:

sudo pkg add -f https://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/pkg-1.14.2.txz

would work as a one-liner, though I have not now tried it successfully.

Last edited: Apr 16, 2020

  • #15

I got into this error after updating from 12.0-RELEASE to 12.1-RELEASE.
The solution that worked for me was to forcibly remove pkg

Code:

root@server:/var/db/pkg # pkg update -f
Updating FreeBSD repository catalogue...
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB  70.9kB/s    01:31
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
root@server:/var/db/pkg # pkg add -f https://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/pkg-1.14.2.txz
Certificate verification failed for /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
34374852608:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:1915:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
34374852608:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:1915:
Certificate verification failed for /C=US/O=Let's


root@server:/var/db/pkg # pkg delete -f pkg
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
    pkg-1.10.5_5

Number of packages to be removed: 1

The operation will free 13 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling pkg-1.10.5_5...
[1/1] Deleting files for pkg-1.10.5_5: 100%
root@server:/var/db/pkg # pkg update -f 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 pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.13.2...
Extracting pkg-1.13.2: 100%
Usage: pkg update [-fq] [-r reponame]

For more information, see 'pkg help update'.
root@server:/var/db/pkg # pkg update
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB 280.4kB/s    00:23
Processing entries: 100%
FreeBSD repository update completed. 31492 packages processed.
All repositories are up to date.
root@server:/var/db/pkg # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (19 candidates): 100%
Processing candidates (19 candidates): 100%
The following 19 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    python37: 3.7.7

Installed packages to be UPGRADED:
    fusefs-libs: 2.9.7 -> 2.9.9_1
    gawk: 4.1.4_3 -> 5.0.0
    gettext-runtime: 0.19.8.1_2 -> 0.20.1
    glib: 2.56.3_2,1 -> 2.56.3_7,1
    haproxy: 1.8.17 -> 2.0.13
    icu: 63.1_1,1 -> 66.1,1
    libdnet: 1.12_1 -> 1.13_3
    libmspack: 0.9.1 -> 0.10.1
    libssh2: 1.8.0,3 -> 1.8.2,3
    libxml2: 2.9.7 -> 2.9.10
    nginx: 1.14.2_3,2 -> 1.16.1_12,2
    open-vm-tools-nox11: 10.3.0_1,2 -> 11.0.1_3,2
    pcre: 8.42_1 -> 8.43_2
    perl5: 5.28.1 -> 5.30.2
    postfix: 3.3.3,1 -> 3.5.0,1
    python27: 2.7.15 -> 2.7.17_1
    readline: 7.0.5 -> 8.0.4
    sudo: 1.8.27 -> 1.8.31p1

Number of packages to be installed: 1
Number of packages to be upgraded: 18

The process will require 114 MiB more space.
62 MiB to be downloaded.

SirDice


  • #16

Try pkg-static install -f pkg or pkg bootstrap -f

  • #17

The first option didn’t work for me. I see the 2nd one for the first time now, I have no clue if it works or not, the problem was solved on my side.

SirDice


  • #18

I see the 2nd one for the first time now

You can learn a lot from the man pages ;)

Code:

     bootstrap
             This is for compatibility with the pkg(7) bootstrapper.  If pkg
             is already installed, nothing is done.

             If invoked with the -f flag an attempt will be made to reinstall
             pkg from remote repository.

See pkg(8) and pkg(7).

  • #19

pkg delete -f pkg

pkg install pkg

dvl@


  • #20

Try pkg-static install -f pkg or pkg bootstrap -f

pkg bootstrap -f is what got us going.

dvl@


  • #22

For me:

sudo pkg bootstrap -f; sudo pkg update -f

got me back in business!

  • #23

I got into this error after updating from 12.0-RELEASE to 12.1-RELEASE.
The solution that worked for me was to forcibly remove pkg

Code:

root@server:/var/db/pkg # pkg update -f
Updating FreeBSD repository catalogue...
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB  70.9kB/s    01:31
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
root@server:/var/db/pkg # pkg add -f https://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/pkg-1.14.2.txz
Certificate verification failed for /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
34374852608:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:1915:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
34374852608:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:1915:
Certificate verification failed for /C=US/O=Let's


root@server:/var/db/pkg # pkg delete -f pkg
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
    pkg-1.10.5_5

Number of packages to be removed: 1

The operation will free 13 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling pkg-1.10.5_5...
[1/1] Deleting files for pkg-1.10.5_5: 100%
root@server:/var/db/pkg # pkg update -f 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 pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.13.2...
Extracting pkg-1.13.2: 100%
Usage: pkg update [-fq] [-r reponame]

For more information, see 'pkg help update'.
root@server:/var/db/pkg # pkg update
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB 280.4kB/s    00:23
Processing entries: 100%
FreeBSD repository update completed. 31492 packages processed.
All repositories are up to date.
root@server:/var/db/pkg # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (19 candidates): 100%
Processing candidates (19 candidates): 100%
The following 19 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    python37: 3.7.7

Installed packages to be UPGRADED:
    fusefs-libs: 2.9.7 -> 2.9.9_1
    gawk: 4.1.4_3 -> 5.0.0
    gettext-runtime: 0.19.8.1_2 -> 0.20.1
    glib: 2.56.3_2,1 -> 2.56.3_7,1
    haproxy: 1.8.17 -> 2.0.13
    icu: 63.1_1,1 -> 66.1,1
    libdnet: 1.12_1 -> 1.13_3
    libmspack: 0.9.1 -> 0.10.1
    libssh2: 1.8.0,3 -> 1.8.2,3
    libxml2: 2.9.7 -> 2.9.10
    nginx: 1.14.2_3,2 -> 1.16.1_12,2
    open-vm-tools-nox11: 10.3.0_1,2 -> 11.0.1_3,2
    pcre: 8.42_1 -> 8.43_2
    perl5: 5.28.1 -> 5.30.2
    postfix: 3.3.3,1 -> 3.5.0,1
    python27: 2.7.15 -> 2.7.17_1
    readline: 7.0.5 -> 8.0.4
    sudo: 1.8.27 -> 1.8.31p1

Number of packages to be installed: 1
Number of packages to be upgraded: 18

The process will require 114 MiB more space.
62 MiB to be downloaded.

Same thing for me 12.0 to 12.1 and removing and then bootstrapping worked! Thanks!

  • #24

This seems to be a chronic problem with 12.0 to 12.1 upgrades. I had 3 systems so far exhibit the same problem. The solution is

Code:

pkg bootstrap -f
pkg update -f

Then you can proceed with pkg upgrade -fy as requested by freebsd-update()
(I figured I might as well add this for myself and others since this post is the first/second result on search engines)

Last edited: Aug 19, 2020

  • #25

I had the same problem , seems pkg bootstrap -f solve it. Thank you.

Jun 01, 2020



I work at Microsoft, and with that, I get free
Azure credits.

Considering where I work, I have no use for FreeBSD at work, only Windows.
However, I spent seven years of my life prior to getting $DAYJOB using
FreeBSD, going back to high school and basically built my personal setup on
it. I haven’t bothered to switch my personal desktop or home server to
Windows (yet*), so I’ll create a FreeBSD VM in Azure and try to update it.

If I create a FreeBSD VM in Azure and update, I get pkg errors as follows:

root@Inst1:/usr/home/neel # pkg upgrade
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01    
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB   6.5MB/s    00:01    
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
root@Inst1:/usr/home/neel #

To fix, this you need to re-bootstrap pkg as follows:

root@Inst1:/usr/home/neel # pkg-static bootstrap -f
pkg(8) is already installed. Forcing reinstallation through pkg(7).
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 pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.13.2...
package pkg is already installed, forced install
Extracting pkg-1.13.2: 100%
root@Inst1:/usr/home/neel #

And then update as normal:

root@Inst1:/usr/home/neel # pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB   3.3MB/s    00:02    
Processing entries: 100%
FreeBSD repository update completed. 31517 packages processed.
All repositories are up to date.
root@Inst1:/usr/home/neel # pkg upgrade
Updaing FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
...
Proceed with this action? [y/N]: y
...

I do recommend updating to a non-EOL release first, as the Azure images may
be out of date, as they are for 12.x.

At the time of writing, I don’t work on Azure, so I have no say in how often
FreeBSD images are updated.

* — Personal desktop/laptop does dual-boot Windows 10 and FreeBSD CURRENT

Содержание

  1. pkg cannot update itself if the meta format has changed #1815
  2. Comments
  3. pkg update error
  4. Lamia
  5. SirDice
  6. SirDice
  7. tsarya
  8. PKG Problem, Can’t Install or Update Packages in 11.2-U7
  9. amp88
  10. amp88
  11. Jailer
  12. amp88
  13. Patrick M. Hausen
  14. amp88
  15. Patrick M. Hausen
  16. Unsupported FreeBSD Releases
  17. amp88
  18. Unsupported FreeBSD Releases
  19. Patrick M. Hausen
  20. FlyingPersian
  21. Patrick M. Hausen
  22. FlyingPersian
  23. SeaFox
  24. damjan
  25. SeaFox
  26. PKG ERROR
  27. coutter
  28. SirDice
  29. Unsupported FreeBSD Releases
  30. jimeha
  31. Deleted member 66267
  32. pkgsrc
  33. jimeha
  34. zirias@
  35. SirDice
  36. T-Daemon
  37. SirDice
  38. zirias@
  39. T-Daemon
  40. jimeha
  41. How To Upgrade To FreeBSD 13 From FreeBSD 12
  42. A Step By Step Guide To Upgrade FreeBSD 12.x To FreeBSD 13.1
  43. Introduction
  44. Update FreeBSD 12
  45. Upgrade To FreeBSD 13 From FreeBSD 12
  46. Troubleshooting Pkg Update Error In FreeBSD
  47. Change Hostname (Optional)

After updating an old machine to 12, I get this error:

pkg-static reports the same error when running the suggested command. Manually downloading the latest pkg-.txz package then let me to pkg add -f ./pkg*.txz , but that’s not something that’s obvious to users (and, without the meta info in the repo, it’s not very secure because there’s no hash provided for the package). pkg can always upgrade itself, but it appears that it can’t always find the package that it needs to be able to upgrade itself.

The text was updated successfully, but these errors were encountered:

This is expected an there is not much we can do. The correct solution is running ‘pkg bootstrap -f’
pkg 1.11 only know about meta version 1.
pkg 1.12 added support for meta version 2.
pkg 1.13 switch meta to version 2.
pkg 1.12 is still the version in quarterly, this issue is only a problem if you’re using latest and do not upgrade often.

There are several things that we could do about this:

  1. Have pkg tell you to run pkg bootstrap -f instead of telling you to run pkg-static install -f pkg .
  2. Have pkg automatically run that if the check failed.
  3. Provide a version 1 meta file that just contains the pkg tool (though this would require the version 2 file having a different name).

Currently, the user experience is very bad if you have a machine that has not been updated for a while. Any version of pkg installed prior to September of last year is currently broken when using the ‘latest’ repo (which, given the lack of real QA or any guarantees of security back-ports to the Quarterly branch, I’d still recommend everyone does).

Источник

pkg update error

I’m getting the following error on my FreeBSD 12.1-RELEASE-p2:

This is my pkg config:

Any thoughts on what might cause the issue?

Lamia

This is my /usr/local/etc/pkg/repos/FreeBSD.conf:

I would add that I’ve had the same setup for quite some time and it only recently broke.

Removing the pkg+http scheme results in a deprecation warning.

Even a bare-minimum .conf like so:

At any rate, I don’t think the problem is with the mirror or the connection, but rather with my local database.

SirDice

Administrator

Reactions: Sevendogsbsd

SirDice

Administrator

I don’t think your local registration database is at fault, it only complains about the meta data and SQL from the locally cached remote repositories. Try removing /var/db/pkg/FreeBSD.meta, /var/db/pkg/FreeBSD_latest.meta, /var/db/pkg/repo-FreeBSD.sqlite and /var/db/pkg/repo-FreeBSD_latest.sqlite. Then running pkg update again.

Do NOT remove /var/db/pkg/local.sqlite (it contains the registrations for your currently installed packages). In case you still want to checkout the backups, they’re in /var/backups/.

Reactions: Brian Cunnie and mfaridi

Thanks for your suggestions.

Unfortunately it sill gives the same «wrong version 2» error as before:

tsarya

Try updating ports-mgmt/pkg from the ports tree using ports-mgmt/portmaster.
If you haven’t fetched the ports tree yet, just do the following:

At the end, you should see pkg version 1.13.2 installed (at the time of writing this post)

Источник

PKG Problem, Can’t Install or Update Packages in 11.2-U7

amp88

Explorer

Hi all. Another strange problem. I just did this procedure a couple of days ago and it worked fine, but now on a clean install of FreeNAS 11.2-U7 it’s failing and I don’t know why. I’m running FreeNAS virtualised in XCP-ng 8.0 and trying to install the xe-guest-utilities package, but it’s failing.

I’m following this procedure (which has worked in a couple of other 11.2-U7 installations I’ve run in the last week or so). Toggle ‘enabled’ in /usr/local/etc/pkg/repos/FreeBSD.conf from ‘no’ to ‘yes’, toggle ‘enabled’ in /usr/local/etc/pkg/repos/local.conf from ‘yes’ to ‘no’, then run ‘pkg install xe-guest-utilities’. However, when I do this I get the following error (with the debug flag enabled to get more verbose output):

amp88

Explorer

In case it’s useful to anyone in figuring this out, here’s the output from running ‘pkg -vv’:

Jailer

Not strong, but bad

amp88

Explorer

Patrick M. Hausen

Hall of Famer

amp88

Explorer

Patrick M. Hausen

Hall of Famer

Unsupported FreeBSD Releases

amp88

Explorer

Unsupported FreeBSD Releases

Patrick M. Hausen

Hall of Famer

FlyingPersian

Patron

I have the same issue in my iocage jails, which are on 11.3.

Here is what happens when I try to update pkg:

And here when I do pkg -d update:

And here when I do pkg -vv:

FlyingPersian, I was making a joke. Survivor is a reality show where people are on an island. I was implying that Lost was also a reality show (which it’s not)
sorry didn#t get that haha
Are you german ?
yes I am
how did you figureß 😀
marbus never gets jokes either
he’s a robot
bite my shiny metal ass.

FlyingPersian: you can use iocage on the cli
that will fetch any jail version you want
oh lord help us.
You may attempt to do this as SweetAndLow says, sir,
but I’ve known you for years,
and I am quite sure it won’t end well.
FlyingPersian> 😀

Patrick M. Hausen

Hall of Famer

FlyingPersian

Patron

Weirdly enough, it works in my other jails, all 11.3

FlyingPersian, I was making a joke. Survivor is a reality show where people are on an island. I was implying that Lost was also a reality show (which it’s not)
sorry didn#t get that haha
Are you german ?
yes I am
how did you figureß 😀
marbus never gets jokes either
he’s a robot
bite my shiny metal ass.

FlyingPersian: you can use iocage on the cli
that will fetch any jail version you want
oh lord help us.
You may attempt to do this as SweetAndLow says, sir,
but I’ve known you for years,
and I am quite sure it won’t end well.
FlyingPersian> 😀

SeaFox

Explorer

Can anyone offer any further advice on this?
It seems I’m having this same issue on multiple 11.3 jails.

damjan

Dabbler

I had the same problem on the upgraded jails. The problem on my system was caused by the outdated repo file in the local directory pointing to FreeBSD 10 repo:
/usr/local/etc/pkg/repos/FreeBSD.conf

I removed the outdated repo config file and pkg update completed successfully; so did the pkg upgrade .

On one of the upgraded zones, pkg did not work because of outdated dependencies. I used pkg-static to upgrade pkg to the latest version followed by the pkg upgrade . Since then I do not have any issues.

So check if you have any /usr/local/etc/pkg/repos/FreeBSD.conf file pointing to the old FreeBSD repo.

SeaFox

Explorer

Nah, that file does not exist by default in the jails. They seem to be configured elsewhere to use the quarterly update manifest and not the latest. But you did give me an idea. I know I can create that file and point it to the Latest packages for FreeBSD, so I tried that, and it also did not work. I was still getting the same error as FlyingPersian.

But I think I just found the solution: pkg bootstrap -f

I seem to be able to update packages normally now. I’m going to roll back this jail and try again one more time to make sure the change in respository is not playing a role, too.

When this first started happening it was a weeks ago, and I thought I was being effected by this bug. But it got resolved and I was still having the issue, even earlier today when I upgraded an old jail.

Edit: Yes — this works, without changing the repository.

No error about repositories. Nothing to update at this point since I’m back to the normal quarterly repo, but I think we’ll be fine.
Thanks for helping me look at this further. I was afraid I would have to remake every jail I have (which I’ve already done with my Plex jail now).

Источник

PKG ERROR

coutter

When trying to run
pkg update && pkg upgrade -y
I get this error:
I tried several methods to solve this and none of them worked out. I’m kinda lost here.

SirDice

Administrator

The entire 10 branch is end-of-life and not supported any more.

Unsupported FreeBSD Releases

jimeha

Deleted member 66267

Guest

I don’t know if anything like that exists. The only thing that works is pkgsrc, which is designed just for this: continue the life of legacy systems!

pkgsrc

jimeha

Apologies for the delayed reply, life in the way. So for much older versions we still have ftp-archive.freebsd.org for versions 1.x through 9.x (on i386) and 5.x ot 9.x (on amd64). But on pkg.freebsd.org, 10.x has been wiped, so now we have a gap then 11+? I would’ve hoped FreeBSD would keep this available on some archive server, just like the older versions. That’s very unfortunate.

I glanced at pkgsrc, but that does seem to involve having to build all of ports at least once, or a portion of it if we want to be able to do final updates to our BSD 10.x systems, before they eventually migrate to 12.x or newer. Is there really no pkg archive of 10.x? Will 1.x through 9.x eventually disappear too then if the move is to only ‘new’ supported stuff to be available from pkg?

zirias@

Cause EOL always hits you like lightning in a clear sky, right?

Operating EOL systems is dangerous, you should never do it, so there’s no point in providing any support for shooting your foot. You can always fetch ports trees from ages ago and build yourself what you need if you insist, but the only sane way is: upgrade.

Reactions: Deleted member 30996

SirDice

Administrator

Those never existed.

There are archives of the releases. Some of those included packages. But they are packages that were built at the time of the release (you could find those included on the CD/DVD images). They are not the ‘last’ builds of that release.

T-Daemon

SirDice

Administrator

zirias@

T-Daemon

jimeha

Those never existed.

There are archives of the releases. Some of those included packages. But they are packages that were built at the time of the release (you could find those included on the CD/DVD images). They are not the ‘last’ builds of that release.

My fault that one; bad comparison then. I suppose a portion of my argument is also for consistency. One could, in theory (not recommended, yes, I know), install an older FreeBSD version right now and set PACKAGESITE to ftp-archive.freebsd.org so pkg_add et al work. Currently, I see no way to do that with, for example, FreeBSD 10.x and pkg without building ports and pointing pkg at that after setting up a frontend to my internal builds that were built and packaged nicely. The pkg.freebsd.org system just doesn’t have FreeBSD:10:amd64 (released or latest) and others anymore, only supported 12.x, etc, releases. This seems like a miss in consistency vs older FreeBSD versions unless this new practice for maintaining pkg.freebsd.org is posted somewhere I haven’t found yet which is entirely possible.

Zirias absolutely agree with your overall premise: 100% use new *supported* releases when possible. Badger those who ‘need’ the old systems to upgrade. However, I’m sure I’m not the only one trying to maintain an old server though for «reasons» by attempting to patch in the very last released builds of a package(s) as an attempt to update it ‘a little bit’ before that OS upgrade oppotunity comes. I had managed to upgrade several before FreeBSD:10:amd64 disappeared, was going to do more of them, but can’t.

Источник

How To Upgrade To FreeBSD 13 From FreeBSD 12

A Step By Step Guide To Upgrade FreeBSD 12.x To FreeBSD 13.1

FreeBSD 13.1 stable version is officially released. This tutorial walks you through the steps to upgrade to FreeBSD 13.1 from FreeBSD 12.3 and older versions.

Introduction

The FreeBSD Release Engineering Team is recently announced the availability of FreeBSD 13.1-RELEASE. This is the second release of the stable/13 branch.

FreeBSD 13.1 is shipped with many updated set of features. It supports several architectures including amd64, i386, powerpc, powerpc64, powerpc64le, powerpcspe, armv6, armv7, aarch64, and riscv64.

If you prefer a fresh installation, head over to the FreeBSD 13.1 download page and get a suitable version for your architecture. And then refer to the following guide to know how to install FreeBSD.

If you’re already running older versions (E.g. FreeBSD 12.x), you can directly upgrade FreeBSD 12.x to FreeBSD 13.1. In this step by step guide, let us see how to upgrade to FreeBSD 13.1 from FreeBSD 12.3 version.

Update FreeBSD 12

First things first. Take a backup of everything that you can’t afford losing. FreeBSD upgrade process worked just fine in my case. However, I strongly recommend you to backup your data.

Let us now go ahead and update the current FreeBSD version.

Check FreeBSD OS version and kernel version using commands:

Sample output:

Sample output:

As you see above, the installed version is FreeBSD 12.3-RELEASE.

Before upgrading to next available major version, we must update our current FreeBSD 12.x version.

To download and install the FreeBSD security patches, run the following commands as root user:

Once the packages are upgraded, reboot your system:

It is time to upgrade FreeBSD 12 to FreeBSD 13.

Upgrade To FreeBSD 13 From FreeBSD 12

As of writing this guide, the latest stable FreeBSD version 13.1.

Run the following command to upgrade to FreeBSD 13.1-RELEASE from FreeBSD 12.x version:

Once you run this command, the freebsd-update command will evaluate the configuration file and current system in an attempt to gather the information necessary to perform the upgrade.

During the upgrade, you will be asked what to install, what to remove or how to proceed. You may need to type y and hit ENTER a few times to continue.

Sample output:

The above command will start to download all packages. Sit back and relax. It will take several minutes depending upon the Internet speed and the number of installed packages on your FreeBSD system.

During the upgrade task, Configuration files will then be merged. The results of every successful merge will be shown to the user as the process continues.

Please note that the current system is not being altered yet, because all merging and patching is happening in another directory.

Once all patches have been applied successfully, all configuration files have been merged, run the following command to commit all changes to the disk:

Sample output:

All Kernel updates have been installed in your FreeBSD, reboot your system to apply the patches.

After logging into the system, run the following command again to finish installing updates:

After all updates are installed, you will see the following output:

Once again the run the same command to remove old shared libraries and complete FreeBSD 13.1 upgrade task.

Finally, reboot your system to complete the upgrade task.

Verify if FreeBSD 13.1 is upgraded successfully by checking the OS version.

And check the FreeBSD Kernel version:

Congratulations! We just upgraded to FreeBSD 13.1.

We need to do one more thing as well. After a major version upgrade, all installed packages and ports should be upgraded.

Update all installed packages and ports collections using the following commands:

That’s it. Reboot once again and start using FreeBSD version.

Troubleshooting Pkg Update Error In FreeBSD

After upgrading to FreeBSD 13, I got the following error when I try to update the ports collections:

This usually happens when we upgrade 12.0 to 12.1 or 2.

To fix this issue, update ports-mgmt/pkg from the ports tree using ports-mgmt/portmaster .

Fetch the ports tree using commands if you haven’t done it already:

Sample output:

Next run the following command to download and extract the entire ports tree to the /usr/ports directory.

This usually happens when we do minor upgrade i.e. 12.0 to 12. After running pkg bootstrap -f everything worked as expected.

Change Hostname (Optional)

I used to set the hostname to any Linux or Unix systems with the operating system’s version. For instance, I will usually set name as «freebsd12» for FreeBSD 12 systems. If you’re anything like me, you should update your hostname to reflect the current version.

As root user, type «hostname «, and the hostname will be changed immediately.

Replace «freebsd13.ostechnix.lan» with your own hostname.

To make this change permanent across reboots, edit the file » /etc/rc.conf » using a text editor:

Add/modify the following line:

Reboot your system to take effect the changes.

Check if the hostname is changed with command:

Perfect! Start using your FreeBSD 13.1 system!!

Источник

FreeBSD 13.1 stable version is officially released. This tutorial walks you through the steps to upgrade to FreeBSD 13.1 from FreeBSD 12.3 and older versions.

Introduction

The FreeBSD Release Engineering Team is recently announced the availability of FreeBSD 13.1-RELEASE. This is the second release of the stable/13 branch.

FreeBSD 13.1 is shipped with many updated set of features. It supports several architectures including amd64, i386, powerpc, powerpc64, powerpc64le, powerpcspe, armv6, armv7, aarch64, and riscv64.

If you prefer a fresh installation, head over to the FreeBSD 13.1 download page and get a suitable version for your architecture. And then refer to the following guide to know how to install FreeBSD.

Install FreeBSD — Step By Step Guide

If you’re already running older versions (E.g. FreeBSD 12.x), you can directly upgrade FreeBSD 12.x to FreeBSD 13.1. In this step by step guide, let us see how to upgrade to FreeBSD 13.1 from FreeBSD 12.3 version.

Update FreeBSD 12

First things first. Take a backup of everything that you can’t afford losing. FreeBSD upgrade process worked just fine in my case. However, I strongly recommend you to backup your data.

Let us now go ahead and update the current FreeBSD version.

Check FreeBSD OS version and kernel version using commands:

# freebsd-version -k

Sample output:

12.3-RELEASE
$ uname -mrs

Sample output:

FreeBSD 12.3-RELEASE amd64
Check FreeBSD OS And Kernel Version
Check FreeBSD OS And Kernel Version

As you see above, the installed version is FreeBSD 12.3-RELEASE.

Before upgrading to next available major version, we must update our current FreeBSD 12.x version.

To download and install the FreeBSD security patches, run the following commands as root user:

# freebsd-update fetch
# freebsd-update install
# pkg upgrade

Once the packages are upgraded, reboot your system:

# shutdown -r now

Or,

# reboot

It is time to upgrade FreeBSD 12 to FreeBSD 13.

Upgrade To FreeBSD 13 From FreeBSD 12

As of writing this guide, the latest stable FreeBSD version 13.1.

Run the following command to upgrade to FreeBSD 13.1-RELEASE from FreeBSD 12.x version:

# freebsd-update -r 13.1-RELEASE upgrade

Once you run this command, the freebsd-update command will evaluate the configuration file and current system in an attempt to gather the information necessary to perform the upgrade.

During the upgrade, you will be asked what to install, what to remove or how to proceed. You may need to type y and hit ENTER a few times to continue.

Sample output:

 src component not installed, skipped
 Looking up update.FreeBSD.org mirrors… 2 mirrors found.
 Fetching metadata signature for 12.3-RELEASE from update1.freebsd.org… done.
 Fetching metadata index… done.
 Fetching 1 metadata files… done.
 Inspecting system… done.
 The following components of FreeBSD seem to be installed:
 kernel/generic kernel/generic-dbg src/src world/base world/base-dbg world/doc
 world/lib32 world/lib32-dbg
 The following components of FreeBSD do not seem to be installed:
 Does this look reasonable (y/n)? y
 Fetching metadata signature for 13.1-RELEASE from update2.freebsd.org… done.
 Fetching metadata index… done.
 Fetching 1 metadata patches. done.
 Applying metadata patches… done.
 Fetching 1 metadata files… 
[...]
Upgrade To FreeBSD 13 From FreeBSD 12 Version
Upgrade To FreeBSD 13 From FreeBSD 12 Version

The above command will start to download all packages. Sit back and relax. It will take several minutes depending upon the Internet speed and the number of installed packages on your FreeBSD system.

During the upgrade task, Configuration files will then be merged. The results of every successful merge will be shown to the user as the process continues.

Please note that the current system is not being altered yet, because all merging and patching is happening in another directory.

Once all patches have been applied successfully, all configuration files have been merged, run the following command to commit all changes to the disk:

# freebsd-update install

Sample output:

ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
Installing updates…
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
Install Downloaded Upgrades
Install Downloaded Upgrades

All Kernel updates have been installed in your FreeBSD, reboot your system to apply the patches.

After logging into the system, run the following command again to finish installing updates:

# freebsd-update install

After all updates are installed, you will see the following output:

[...]
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

Once again the run the same command to remove old shared libraries and complete FreeBSD 13.1 upgrade task.

# freebsd-update install

Finally, reboot your system to complete the upgrade task.

Verify if FreeBSD 13.1 is upgraded successfully by checking the OS version.

# freebsd-version -k
13.1-RELEASE

And check the FreeBSD Kernel version:

# uname -mrs
FreeBSD 13.1-RELEASE amd64
Display FreeBSD OS And Kernel Version
Display FreeBSD OS And Kernel Version

Congratulations! We just upgraded to FreeBSD 13.1.

We need to do one more thing as well. After a major version upgrade, all installed packages and ports should be upgraded.

Update all installed packages and ports collections using the following commands:

# pkg-static install -f pkg
# pkg bootstrap -f
# pkg update
# pkg upgrade -y

That’s it. Reboot once again and start using FreeBSD version.

Troubleshooting Pkg Update Error In FreeBSD

After upgrading to FreeBSD 13, I got the following error when I try to update the ports collections:

 pkg-static: Warning: Major OS version upgrade detected.  Running "pkg-static install -f pkg" recommended
 Updating FreeBSD repository catalogue…
 pkg-static: repository meta has wrong version 2
 pkg-static: Repository FreeBSD load error: meta cannot be loaded No error: 0
 Fetching meta.txz: 100%    916 B   0.9kB/s    00:01    
 pkg-static: repository meta has wrong version 2
 repository FreeBSD has no meta file, using default settings
 Fetching packagesite.txz: 100%    6 MiB   1.6MB/s    00:04    
 pkg-static: repository meta has wrong version 2
 pkg-static: Repository FreeBSD load error: meta cannot be loaded No error: 0
 Unable to open created repository FreeBSD
 Unable to update repository FreeBSD
 Error updating repositories!

This usually happens when we upgrade 12.0 to 12.1 or 2.

To fix this issue, update ports-mgmt/pkg from the ports tree using ports-mgmt/portmaster.

Fetch the ports tree using commands if you haven’t done it already:

# portsnap fetch

Sample output:

 Looking up portsnap.FreeBSD.org mirrors… 4 mirrors found.
 Fetching public key from ipv4.aws.portsnap.freebsd.org… done.
 Fetching snapshot tag from ipv4.aws.portsnap.freebsd.org… done.
 Fetching snapshot metadata… done.
 Fetching snapshot generated at Sat May 28 05:59:31 IST 2022:
 552628c35b88d79f5a54b7774ddca0463fde713e43f367          88 MB 3233 kBps    28s
 Extracting snapshot… done.
 Verifying snapshot integrity… done.
 Fetching snapshot tag from ipv4.aws.portsnap.freebsd.org… done.
 Fetching snapshot metadata… done.
 Updating from Sat May 28 05:59:31 IST 2022 to Sat May 28 17:23:31 IST 2022.
 Fetching 5 metadata patches… done.
 Applying metadata patches… done.
 Fetching 0 metadata files… done.
 Fetching 18 patches. 
 (18/18) 100.00%  done.                             
 done.
 Applying patches… 
 done.
 Fetching 0 new ports or files… done.

Next run the following command to download and extract the entire ports tree to the /usr/ports directory.

# portsnap extract

And then run:

# pkg bootstrap -f
# pkg update -f
# pkg upgrade -f

This usually happens when we do minor upgrade i.e. 12.0 to 12. After running pkg bootstrap -f everything worked as expected.

Change Hostname (Optional)

I used to set the hostname to any Linux or Unix systems with the operating system’s version. For instance, I will usually set name as «freebsd12» for FreeBSD 12 systems. If you’re anything like me, you should update your hostname to reflect the current version.

As root user, type «hostname <new hostname>», and the hostname will be changed immediately.

# hostname freebsd13.ostechnix.lan

Replace «freebsd13.ostechnix.lan» with your own hostname.

To make this change permanent across reboots, edit the file «/etc/rc.conf» using a text editor:

# vi /etc/rc.conf

Add/modify the following line:

hostname="freebsd13.ostechnix.lan"

Reboot your system to take effect the changes.

Check if the hostname is changed with command:

# hostname
freebsd13.ostechnix.lan
Check FreeBSD Hostname
Check FreeBSD Hostname

Perfect! Start using your FreeBSD 13.1 system!!

Related read:

  • How To Enable SSH On FreeBSD

Patch Level Update:

root@bsd12:~ # freebsd-version
12.1-RELEASE
root@bsd12:~ # freebsd-update fetch install
root@bsd12:~ # shutdown -r now
root@bsd12:~ # freebsd-version
12.1-RELEASE-p10
root@bsd12:~ # pkg update && pkg upgrade

and you are done….

Minor and Major version Upgrade:
//Note for Dumb & blindly trusting users: below is just a example change “12.0-RELEASE” with version number you want to upgrade DO NOT try to upgrade 12.1-RELEASE to 12.0-RELEASE

# freebsd-update fetch install
# pkg update && pkg upgrade
# freebsd-update -r 12.0-RELEASE upgrade
# freebsd-update install
# shutdown -r now
# freebsd-update install

If its minor upgrade it will just install upgrades and most like you would not need to rebuild packages. In case you get below msg follow next steps just like a major upgrade.

For major upgrade you will need to rebuild packages and follow next steps:

Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

# pkg-static install -f pkg

Possible problem:

pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0

Solution would be deleting the pkg and reinstalling:
# pkg delete -f pkg
# pkg update -f pkg

or

# pkg-static install -f pkg

This will re install pkg then

# pkg update
# pkg upgrade
# freebsd-update install

In case you run out of space during these upgrades (if you are doing couple of minor upgrades one by one) you can remove downloaded packages located under:

/var/db/freebsd-update/files/

if you are deleting with rm command

# rm -f *.gz

you can get below error

# /bin/rm: Argument list too long

to see max arg conf in your system you can run # getconf ARG_MAX

You can use below command to overcome this problem, just dont forget you need to be in /var/db/freebsd-update/files/ directory

# find . -type f -exec rm -v {} ;

if you want to delete specific extension

# find . -maxdepth 1 -name "*.gz" -print0 | xargs -0 rm

Also if your default shell is anything other then sh another possible problem you would face would be broken shell. You would get a error something like:

Shared object "libdl.so.1" not found, required by "bash"

And your connection will clode or you wont be able to login system. In this case you need to boot to single usermode (click ‘s’ on boot) and change your default shell:

If you’re using UFS:

# mount -uw /

On ZFS you’d use:

# zfs set readonly=off zroot/DEFAULT/root

Then fix your shell:

# pw usermod root -s /bin/csh
or
# pw usermod root -s /bin/sh

Or use:
# chsh
and edit your profile file and fix the shell entry

Понравилась статья? Поделить с друзьями:
  • Pkcs11 rutoken ошибка 0x7
  • Pkcs11 rutoken ошибка 0x6
  • Pkcs11 ckr device error
  • Pk client error quark ubuntu
  • Pk client error quark cannot download packages whilst offline 257