正文

CentOS下更新SQLite版本(centos8更新命令)全程干货

文章摘要

这篇文章介绍了如何在Linux系统上手动更新SQLite到最新版本(3.27.2)。主要内容包括获取SQLite源代码、编译、安装以及设置共享库路径(LD_LIBRARY_PATH)的步骤。文章还对比了更新后的SQLite版本与系统原生SQLite(3.7.17)的版本号,显示更新后的SQLite版本为3.27.2,发布时间为2019年2月25日。通过手动更新,用户可以安装最新版本的SQLite,以获得更好的性能和稳定性。文章强调了手动更新SQLite的优势,尤其是不需要依赖第三方软件包的稳定性。

 #更新SQLite 3 #获取源代码(在主目录中运行) [root@djangoServer ~]# cd ~ [root@djangoServer ~]# wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz [root@djangoServer ~]# tar -zxvf sqlite-autoconf-3270200.tar.gz #构建并安装 [root@djangoServer ~]# cd sqlite-autoconf-3270200 [root@djangoServer sqlite-autoconf-3270200]# https://www.jb51.net/article/configure –prefix=/usr/local/sqlite [root@djangoServer sqlite-autoconf-3270200]# make && make install #检查版本 ## 最新安装的sqlite3版本 [root@djangoServer ~]# /usr/local/sqlite/bin/sqlite3 –version 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7 [root@djangoServer ~]# ## Centos7自带的sqlite3版本 [root@djangoServer ~]# /usr/bin/sqlite3 –version 3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668 [root@djangoServer ~]# ## 可以看到sqlite3的版本还是旧版本,那么需要更新一下。 [root@djangoServer ~]# sqlite3 –version 3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668 [root@djangoServer ~]# ## 更改旧的sqlite3 [root@djangoServer ~]# mv /usr/bin/sqlite3 /usr/bin/sqlite3_old ## 软链接将新的sqlite3设置到/usr/bin目录下 [root@djangoServer ~]# ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3 ## 查看当前全局sqlite3的版本 [root@djangoServer ~]# sqlite3 –version 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7 [root@djangoServer ~]# #将路径传递给共享库 # 设置开机自启动执行,可以将下面的export语句写入 ~/.bashrc 文件中,如果如果你想立即生效,可以执行source ?/.bashrc 将在每次启动终端时执行 [root@djangoServer ~]# export LD_LIBRARY_PATH=/usr/local/sqlite/lib