{"id":14039,"date":"2022-01-18T18:22:18","date_gmt":"2022-01-18T18:22:18","guid":{"rendered":"https:\/\/linuxways.net\/?p=14039"},"modified":"2022-01-18T18:22:18","modified_gmt":"2022-01-18T18:22:18","slug":"how-to-install-sqlite-on-debian-11","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-install-sqlite-on-debian-11\/","title":{"rendered":"How to Install SQLite on Debian 11"},"content":{"rendered":"<p>Written in C language, <a href=\"https:\/\/www.sqlite.org\/index.html\">SQLite<\/a> is a lightweight and fully-featured software library that provides an SQL database engine. Unlike conventional relational databases such as PostgreSQL and SQL, SQLite is serverless and does not require any configuration. Also, give its serverless architecture, it does not have a daemon or proceess that needs to be started or stopped. SQLite requires minimal support from external libraries or from the operating system. As such it is ideal for use in embedded devices such s smartphones, gaming consoles, portable media players etc.<\/p>\n<p>Let us check out how you can install SQLite on Debian 11.<\/p>\n<h2><strong>Method 1: Install SQLite via APT<\/strong><\/h2>\n<p>SQLite can be found in the default debian 11 repositories. Install it using APT as follows:<\/p>\n<pre><strong>$ sudo apt install sqlite3<\/strong><\/pre>\n<p>Confirm the version of sqlite installed with the command:<\/p>\n<pre><strong>$ sqlite3 --version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"96\" class=\"wp-image-14040\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-365.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-365.png 777w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-365-300x37.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-365-768x95.png 768w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/strong><\/p>\n<p>The output confirms that we are running SQLite 3.34.1. However, this is not the latest version of SQL. If you want to install the latest SQLite version, you need to install it from source as we shall demonstrate in the next method.<\/p>\n<h2><strong>Method 2: Compile and Install SQLite from source<\/strong><\/h2>\n<p>To install the latest version, consider manually compiling the source code.<\/p>\n<p>First, install basic compiler packages. Run:<\/p>\n<pre><strong>$ sudo apt install build-essential<\/strong><\/pre>\n<p>Then, create a directory to hold SQLite3 and its contents:<\/p>\n<pre><strong>$ mkdir \/opt\/sqlite3<\/strong><\/pre>\n<p>Thereafter, head over to the official SQLite download page and grab the latest binary file.<\/p>\n<pre><strong>$ wget https:\/\/www.sqlite.org\/2022\/sqlite-autoconf-3370200.tar.gz<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"776\" height=\"253\" class=\"wp-image-14041\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-366.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-366.png 776w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-366-300x98.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-366-768x250.png 768w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\" \/><\/strong><\/p>\n<p>At the time of writing this guide, the latest version of SQLite is 3.37.2. Extract the archive file as shown:<\/p>\n<pre><strong>$ tar xvfz sqlite-autoconf-3370200.tar.gz<\/strong><\/pre>\n<p>Next, move the decompressed folder to the directory you created above.<\/p>\n<pre><strong>$ sudo mv sqlite-autoconf-3370200 \/opt\/sqlite3<\/strong><\/pre>\n<p>Next, navigate to the SQLite folder.<\/p>\n<pre><strong>$ cd \/opt\/sqlite3\/sqlite-autoconf-3370200<\/strong><\/pre>\n<p>The next step is to start the compiling process by executing the command:<\/p>\n<pre><strong>$ .\/configure<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"377\" class=\"wp-image-14042\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-367.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-367.png 753w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-367-300x150.png 300w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/strong><\/p>\n<p>After that, start the build process with the make command as shown:<\/p>\n<pre><strong>$ make -j 2<\/strong><\/pre>\n<p>The -j represents the number of cores present in your system. This helps you speed up the build process. To verify the number of CPU cores present on your system, invoke the nproc command:<\/p>\n<pre><strong>$ nproc<\/strong><\/pre>\n<p>Finally, initiate the build process to install SQLite 3 as follows:<\/p>\n<pre><strong>$ sudo make install<\/strong><\/pre>\n<p>Now confirm the version of SQLite installed with the command:<\/p>\n<pre><strong>$ sqlite3 --version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"79\" class=\"wp-image-14043\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-368.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-368.png 779w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-368-300x30.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-368-768x78.png 768w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/strong><\/p>\n<p>The version installed is more recent as compared to the one installed via APT.<\/p>\n<h2><strong>Testing SQLite<\/strong><\/h2>\n<p>Now that SQLite is successfully installed on our system, we can go ahead and create a database to test the installation. Run:<\/p>\n<pre><strong>$ sqlite3 new_db<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"274\" class=\"wp-image-14044\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-369.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-369.png 715w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-369-300x115.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/strong><\/p>\n<p>You can now type in your SQL commands in the SQLite command line as shown above.<\/p>","protected":false},"excerpt":{"rendered":"<p>Written in C language, SQLite is a lightweight and fully-featured software library that provides an SQL database engine. Unlike conventional relational databases such as PostgreSQL and SQL, SQLite&hellip;<\/p>","protected":false},"author":1,"featured_media":14139,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[521,855],"class_list":["post-14039","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","tag-debian-11","tag-sqlite"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/14039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=14039"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/14039\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/14139"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=14039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=14039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=14039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}