admin avatar

pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2的解決方法

🕞 by admin

首先創建了清華大學的freebsd pkg源

參考 https://mirrors.ustc.edu.cn/help/freebsd-pkg.html

mkdir -p /usr/local/etc/pkg/repos

1
2
3
4
5
vi /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
  url: "pkg+http://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly",
}
wq!
執行pkg 的任意命令時出現了下面的錯誤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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   2.2MB/s    00:03    
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!

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

解決方法很簡單,執行下面命令即可
pkg bootstrap -f

問題解決。。。

你也可以執行命令查看PKG 軟件包的配置信息

pkg -vv

💘 相关文章

写一条评论