# Updated from system 11.2 to 13.1.



## bagas (Oct 28, 2022)

Hello.
Updated from system 11.2 to 13.1.
Did I update correctly, immediately from 11.2 to 13.1?
`freebsd-update upgrade -r 13.1`
After I reboot the server and try to install the software.

```
freebsd-version
13.1-RELEASE-p2
```


```
# pkg update
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory
pkg: http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/meta.txz: Not Found
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/packagesite.txz: Not Found
Unable to update repository FreeBSD
Error updating repositories!
```


```
# host pkg.FreeBSD.org
pkg.FreeBSD.org is an alias for pkgmir.geo.FreeBSD.org.
pkgmir.geo.FreeBSD.org has address 139.178.72.201
pkgmir.geo.FreeBSD.org has IPv6 address 2604:1380:2000:9501::50:2
pkgmir.geo.FreeBSD.org mail is handled by 0 .
```
Haven't used the binary update yet.
This is a VPS server and it is not advisable to compile the system.


----------



## SirDice (Oct 28, 2022)

bagas said:


> Did I update correctly, immediately from 11.2 to 13.1?


That should be fine. But you need to finish the upgrade. You've only done `freebsd-update install` once. It has to be run _three_ times.


----------



## bagas (Oct 28, 2022)

SirDice said:


> That should be fine. But you need to finish the upgrade. You've only done `freebsd-update install` once. It has to be run _three_ times.




```
# freebsd-update install
src component not installed, skipped
No updates are available to install.
Run '/usr/sbin/freebsd-update fetch' first.
```


```
# freebsd-update fetch
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 13.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 13.1-RELEASE-p2.
root@SRVTZGYRG8MR4:~ # freebsd-update install
src component not installed, skipped
No updates are available to install.
Run '/usr/sbin/freebsd-update fetch' first.
root@SRVTZGYRG8MR4:~ #
```


```
# pkg -vv
Version                 : 1.10.5
PKG_DBDIR = "/var/db/pkg";
PKG_CACHEDIR = "/var/cache/pkg";
PORTSDIR = "/usr/ports";
INDEXDIR = "";
INDEXFILE = "INDEX-11";
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:11:amd64";
ALTABI = "freebsd:11:x86:64";
DEVELOPER_MODE = false;
VULNXML_SITE = "[URL]http://vuxml.freebsd.org/freebsd/vuln.xml.bz2[/URL]";
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.10.5";
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";
    raw = "info -R";
    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 = 1102000;
IGNORE_OSVERSION = false;


Repositories:
  FreeBSD: { 
    url             : "pkg+[URL]http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly[/URL]",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
```
Why hasn't the repository changed?

```
url             : "pkg+[URL]http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly[/URL]",
```


----------



## SirDice (Oct 28, 2022)

bagas said:


> Why hasn't the repository changed?


Because you hard-coded it? Did you create a /usr/local/etc/pkg/repos/FreeBSD.conf? If yes, what's in it?

ABI isn't indicating the right version either.

```
ABI = "FreeBSD:11:amd64";
ALTABI = "freebsd:11:x86:64";
```

What does your /etc/pkg/FreeBSD.conf look like? You also want to check /usr/local/etc/pkg.conf.


----------



## bagas (Oct 28, 2022)

```
egrep -v '^$|^#' /etc/pkg/FreeBSD.conf
FreeBSD: {
  url: "pkg+[URL]http://pkg.FreeBSD.org/$[/URL]{ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
```


```
# egrep -v '^$|^#' /usr/local/etc/pkg.conf
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,
  raw: info -R,
  required-depends: info -qr,
  roptions: rquery -i "%n - %Ok: %Ov",
  shared-depends: info -qB,
  show: info -f -k,
  size: info -sq,
  }
```

I did not write anything in these files.


----------



## SirDice (Oct 28, 2022)

bagas said:


> I did not write anything in these files.


Ok, that's fine. Just checking various files that _could_ be problematic. 

What does `freebsd-version -r` output?


----------



## bagas (Oct 28, 2022)

```
# cat /etc/pkg/FreeBSD.conf
# $FreeBSD: releng/11.2/etc/pkg/FreeBSD.conf 333474 2018-05-10 23:58:33Z gjb $
```
For some reason, the system files were not updated after installing the update.
Maybe somehow the update of the system and the world was installed crookedly.


----------



## SirDice (Oct 28, 2022)

bagas said:


> For some reason, the system files were not updated after installing the update.


That's fine. This file hasn't changed. From 13.0 onward those subversion IDs have disappeared anyway.


----------



## bagas (Oct 28, 2022)

SirDice said:


> What does `freebsd-version -r` output?


 freebsd-version -r
13.1-RELEASE-p2


----------



## bagas (Oct 28, 2022)

SirDice said:


> That's fine. This file hasn't changed. From 13.0 onward those subversion IDs have disappeared anyway.





> cat /etc/master.passwd
> # $FreeBSD: releng/11.2/etc/master.passwd 299365 2016-05-10 12:47:36Z bcr $
> #



Not updated.


----------



## SirDice (Oct 28, 2022)

Lets try to bootstrap a proper pkg(8) and see if that helps; `pkg bootstrap -f`


----------



## bagas (Oct 28, 2022)

SirDice said:


> pkg bootstrap -f





> # pkg bootstrap -f
> 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:11:amd64/quarterly, please wait...
> ...


I already did this.


> Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait...


----------



## SirDice (Oct 28, 2022)

I'm quickly running out of ideas. Are you booting with GRUB perhaps?


----------



## Alain De Vos (Oct 28, 2022)

Is /usr/local/etc/pkg empty ?


----------



## bagas (Oct 28, 2022)

SirDice said:


> I'm quickly running out of ideas. Are you booting with GRUB perhaps?


Deleted the system.
Installed initially 13.1, everything is fine now.


----------

