Cài đặt SQLite3 trên AlmaLinux 9 từ nguồn.
SQLite được sử dụng rộng rãi, nhẹ, và hệ thống quản lý cơ sở dữ liệu quan hệ nhúng (RDBMS) hỗ trợ nhiều ngôn ngữ lập trình. Nó được biết đến với tính di động của nó, bản chất khép kín, và kích thước nhỏ, làm cho nó trở thành lựa chọn phổ biến cho các ứng dụng yêu cầu lưu trữ dữ liệu cục bộ.
điều kiện tiên quyết:
- AlmaLinux 9 hệ điều hành
- Root or sudo user privileges
bước:
- Update the system:
dnf update -y
- Install required packages:
The wget package is needed to download the SQLite source code from the official website. If wget is already installed, skip this step.
dnf install wget -y
- Install the build toolchain:
The build toolchain includes various development tools required for compiling SQLite. If you are unsure about the specific packages needed, you can install the entire “Development Tools” nhóm.
dnf groupinstall "Development Tools" -y
- Download the SQLite source code:
- Navigate to the SQLite download page: https://www.sqlite.org/download.html
- Copy the link to the latest autoconf source code, which will be named in the format: sqlite-autoconf-<phiên bản>.tar.gz
- Download the source code using wget and extract it using tar:
wget https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz
tar xvfz sqlite-autoconf-<version>.tar.gz
- Rename the extracted directory to “sqlite”:
mv sqlite-autoconf-<version> sqlite
- Change to the sqlite directory:
cd sqlite
- Build and install SQLite3:
- Run the configure script to prepare the build environment:
./configure
- Compile the SQLite source code:
make
- Install SQLite:
make install
This will install the SQLite3 library system-wide.
- Verify the installation:
Check the SQLite3 version to confirm the installation:
sqlite3 --version
This should display the installed SQLite version, chẳng hạn như:
3.42.0 2023-07-18 11:54:15
456j34k6j34oij64kj6543kj6kj34j6kl4j63l4kj6kl34j634643j6klj34k6j
Phần kết luận:
This tutorial has demonstrated the process of installing SQLite3 on AlmaLinux 9. SQLite is now ready for use in your applications.