服务器环境是centos8stream, 默认的sqlite是 3.26 ,因此,需要升级。
sqlite官网:SQLite Download Page
1.从官网下载最新源码包
cd /opt/wget https://www.sqlite.org/2023/sqlite-autoconf-3440200.tar.gztar xvf sqlite-autoconf-3440200.tar.gzcd sqlite-autoconf-3440200/
2.编译安装
./configuremake -j 4make install
安装日志如下
make[1]: Entering directory '/opt/sqlite-autoconf-3440200' /usr/bin/mkdir -p '/usr/local/lib' /bin/sh ./libtool --mode=install /usr/bin/install -c libsqlite3.la '/usr/local/lib'libtool: install: /usr/bin/install -c .libs/libsqlite3.so.0.8.6 /usr/local/lib/libsqlite3.so.0.8.6libtool: install: (cd /usr/local/lib && { ln -s -f libsqlite3.so.0.8.6 libsqlite3.so.0 || { rm -f libsqlite3.so.0 && ln -s libsqlite3.so.0.8.6 libsqlite3.so.0; }; })libtool: install: (cd /usr/local/lib && { ln -s -f libsqlite3.so.0.8.6 libsqlite3.so || { rm -f libsqlite3.so && ln -s libsqlite3.so.0.8.6 libsqlite3.so; }; })libtool: install: /usr/bin/install -c .libs/libsqlite3.lai /usr/local/lib/libsqlite3.lalibtool: install: /usr/bin/install -c .libs/libsqlite3.a /usr/local/lib/libsqlite3.alibtool: install: chmod 644 /usr/local/lib/libsqlite3.alibtool: install: ranlib /usr/local/lib/libsqlite3.alibtool: finish: PATH="/data/devworker/py311/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/.dotnet/tools:/root/bin:/sbin" ldconfig -n /usr/local/lib----------------------------------------------------------------------Libraries have been installed in: /usr/local/libIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify the full pathname of the library, or use the '-LLIBDIR'flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf'See any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.---------------------------------------------------------------------- /usr/bin/mkdir -p '/usr/local/bin'/bin/sh ./libtool --mode=install /usr/bin/install -c sqlite3 '/usr/local/bin'libtool: install: /usr/bin/install -c sqlite3 /usr/local/bin/sqlite3 /usr/bin/mkdir -p '/usr/local/include' /usr/bin/install -c -m 644 sqlite3.h sqlite3ext.h '/usr/local/include' /usr/bin/mkdir -p '/usr/local/share/man/man1' /usr/bin/install -c -m 644 sqlite3.1 '/usr/local/share/man/man1' /usr/bin/mkdir -p '/usr/local/lib/pkgconfig' /usr/bin/install -c -m 644 sqlite3.pc '/usr/local/lib/pkgconfig'make[1]: Leaving directory '/opt/sqlite-autoconf-3440200'
3.添加类库路径,并加载
vim /etc/ld.so.conf.d/sqlite.conf# 内容如下/usr/local/lib
内容填写上面lib库的位置:/usr/local/lib
ldconfigldconfig-p|grep sqlite
这个就是最新的sqlite3的lib库问题
可以看到已经完成升级安装