centos7更新sqlite3版本
前言
在centos7上安装django测试的时候,出现:
raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17)
这是由于centos7默认安装的sqlite3版本为3.1.17,而我安装的django版本为django3.0,要求sqlite3的版本最低为3.8.3
升级sqlite3
下载源码包编译安装
wget https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
tar -zxvf sqlite-autoconf-3280000.tar.gz
cd sqlite-autoconf-3280000
./configure --prefix=/usr/local
make && make install
删除不必要的文件
rm -rf sqlite-autoconf-3280000*
备份原版本,并建立新版本软连接
mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
配置环境变量~/.bashrc
export LD_LIBRARY_PATH="/usr/local/lib"
source ~/.bashrc
升级完成,查看版本为最新sqlite3版本。