我试图在FreeBSD 10.2系统上安装bash,请参阅如何在FreeBSD上安装bash
但是安装失败了,因为pkg试图从一个太新的存储库中获取信息。
然后我试着遵循https://glasz.org/sheeplog/2017/02/freebsd-usrlocalliblibpkgso3-undefined-symbol-utimensat.html的配方,几个消息人士说这是正确的做法。
然而,食谱的一部分涉及卸载pkg并重新安装它。其结果如下:
# pkg install -y 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:10:amd64/release_2, please
wait...
Verifying signature with trusted certificate
pkg.freebsd.org.2013102301... done
pkg-static: warning: database version 34 is newer than libpkg(3)
version 31, but still compatible
pkg-static: sqlite error while executing INSERT OR ROLLBACK INTO
pkg_search(id, name, origin) VALUES (?1, ?2 || '-' || ?3, ?4); in
file pkgdb.c:1542: no such table: pkg_search所以现在我被困住了。有人能告诉我如何从这种状态中恢复过来吗?
发布于 2018-10-28 13:24:43
您可以尝试删除/var/db/pkg/目录中的所有内容,但正确的解决方案是升级到支持的FreeBSD版本(10.4或11.2)。
发布于 2019-08-20 21:54:23
我最近遇到了类似的症状(为可读性而添加的行间隔):
# pkg info
pkg: Warning: Major OS version upgrade detected. \
Running "pkg-static install -f pkg" recommended
pkg: warning: database version 34 is newer than libpkg(3) version 33, \
but still compatible
pkg: sqlite error while executing INSERT OR ROLLBACK INTO pkg_search(id, name, origin) \
VALUES (?1, ?2 || '-' || ?3, ?4); in file pkgdb.c:1544: \
no such table: pkg_search我集中讨论了错误消息的这一部分:
no such table: pkg_search在我的具体案例中,我能够通过这样做来解决我的问题:
# cp -p /var/db/pkg/local.sqlite /var/db/pkg/local.sqlite.safety
# sqlite3 /var/db/pkg/local.sqlite
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite> CREATE VIRTUAL TABLE pkg_search USING fts4(id, name, origin);
sqlite> .quit从2017年1月开始,这条线中就提到了这个特定的SQL查询。
在此SQL咒语之后,pkg再次发挥作用,我能够升级到pkg的最新版本,然后升级或重新安装其余的软件包。这是一个10.x到12.x的迁移,所以在升级pkg之后,我对所有的东西都做了pkg upgrade -f,并且没有更多的警告或sqlite3错误:
# pkg -N; pkg info; pkg upgrade
pkg: 15 packages installed
apache24-2.4.41 Version 2.4.x of Apache web server
apr-1.7.0.1.6.1 Apache Portability Library
bash-5.0.7 GNU Project's Bourne Again SHell
db5-5.3.28_7 Oracle Berkeley DB, revision 5.3
expat-2.2.6_1 XML 1.0 parser written in C
gdbm-1.18.1_1 GNU database manager
gettext-runtime-0.20.1 GNU gettext runtime libraries and programs
indexinfo-0.3.1 Utility to regenerate the GNU info page index
libnghttp2-1.39.2 HTTP/2.0 C Library
libxml2-2.9.9 XML parser library for GNOME
linux_base-f10-10_10 Base set of packages needed in Linux mode for i386/amd64 (Linux Fedora 10)
pcre-8.43_2 Perl Compatible Regular Expressions library
perl5-5.30.0 Practical Extraction and Report Language
pkg-1.11.1 Package manager
readline-8.0.0 Library for editing command lines as they are typed
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.https://unix.stackexchange.com/questions/478217
复制相似问题