Sqlite for linux install

How to Install SQLite3 on Ubuntu 22.04

SQLite3 is a Database Management System (DBMS) used to manage the data stored on web applications and websites. This DBMS is easy to install and does not need any configuration. SQLite3 is recommended to use in IoT (Internet of Things) projects and for storing cameras, televisions, and cell phone data.

This guide will explore different installation methods of SQLite3 on Ubuntu 22.04.

How to Install SQLite3 on Ubuntu 22.04?

For the installation of SQLite3 on Ubuntu 22.04, you can use:

  • Package provided by default repository
  • Downloading its installation package from the official website

Let’s check out each method one by one.

Method 1: Install SQLite3 on Ubuntu using Default Repository

To Install SQLite3 on Ubuntu using Default Repository, follow the provided procedure.

Step 1: Check SQLite3 package in Default Repository

First, check the availability of the SQLite3 package in the default repository of Ubuntu:

Step 2: Install SQLite3

After verification, use the APT package manager to install the SQLite3 package on your system:

$ sudo apt install sqlite3 -y

Step 3: Confirm SQLite3 Installation

After SQLite 3 installation, check its version using the command:

As you can see, we have successfully installed SQLite version “3.72.2” on our system:

Method 2: Install SQLite3 on Ubuntu through its website

Another method of installing the SQLite3 on Ubuntu is downloading the installation package from the official website.

Step 1: Download SQLite3 Package

Utilize the given “wget” command to download SQLite 3 package:

$ wget -c https://www.sqlite.org/2022/sqlite-autoconf-3390000.tar.gz

Step 2: Create and Move to SQLite3 Directory

Читайте также:  Python создать виртуальное окружение linux

Make a directory named “SQLite3” and navigate to it:

$ mkdir SQLite3 && cd SQLite3

The purpose of making a new directory is to store the SQLite3 configuration file.

Step 3: Extract SQLite3 Package

Now, we will extract the SQLite3 downloaded file in the newly created directory:

$ tar xvfz ../sqlite-autoconf-3390000.tar.gz

Step 4: Compile SQLite3 Configuration File

Navigate the extracted folder of “sqlite-autoconf-3390000” and compile the configuration file:

$ cd sqlite-autoconf-3390000 && ./configure

Step 5: Install SQLite3

Now, install SQLite3 using the following command:

Step 6: Launch SQLite3

Launch SQLite3 on Ubuntu 22.04:

Or you can use, the database name in which we want to work. For instance, we have specified “itsLinuxFoss” as our database name:

$ sudo sqlite3 itsLinuxFoss.db

Step 7: Exit SQLite3

To exit from the SQLite3 environment, we will simply use the command “.quit”:

How to Uninstall SQLite 3 in Ubuntu 22.04?

For the uninstallation of SQLite 2 from Ubuntu 22.04, run the following command:

We have provided the easiest methods related to the installation of SQLite3 in Ubuntu 22.04.

Conclusion

To install SQLite3 in Ubuntu 22.04, you can execute the “sudo apt install sqlite3 -y” command. In the second approach, download the SQLite3 package from the official website using the “wget” command. After doing so, extract it, and install the desired package. This article discussed different methods for installing SQLite3 in Ubuntu 22.04.

TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY

Источник

How to Install SQLite and SQLite Browser in Ubuntu

SQLite is a lightweight, small and self-contained RDBMS in a C library. Popular databases like MySql, PostgreSQL, etc. works in the client-server model and they have a dedicated process running and controlling all the aspects of database operation.

But SQLite has no process running and has no client-server model. SQLite DB is simply an file with .sqlite3/.sqlite/.db extension. Every programming language has a library to support SQLite.

You can find SQLite being used in

  • Web browsers (Chrome, Safari, Firefox).
  • MP3 players, set-top boxes, and electronic gadgets.
  • Internet of Things (IoT).
  • Android, Mac, Windows, iOS, and iPhone devices.

There are lot more areas where SQLite is used. Every smartphone in the world has hundreds of SQLite database files and there are over one trillion databases in active use. That’s quite huge in numbers.

Install SQLite in Ubuntu

Setting up SQLite is simple compared to other popular databases like MySql, Postgresql, etc. First, update apt-cache by running the following command.

Читайте также:  Gdb for arm linux

Now check if there are any SQLite packages available in the apt repository by running the following command.

$ sudo apt-cache search sqlite

To install the package run the following command.

You can validate the installation by starting the sqlite session by running the following command.

Start SQLite Session

You can see from the above image SQLite3 is successfully installed and running with version 3.33.0..

Create SQLite Database and Table

The database is simply stored as a file in your local file system. You can create a database when launching the sqlite session by mentioning the database name as an argument. If the database is available it will open the database if not it creates a new database.

If we are not passing the database name as an argument then a temporary in-memory database is created which will be deleted once the session is terminated. Here I don’t have any database so I will create a new DB by mentioning the DB name as an argument. Once you are connected to the session you can run the .databases command to see which file is attached to the database.

$ sqlite3 /home/tecmint/test # creating test db in /home/tecmint sqlite> .databases # To see which database session is connected

Create SQLite Database

Now let’s create a sample table by executing the following queries.

# create table sqlite> CREATE TABLE employee( Name String, age Int); # Insert records sqlite> insert into employee(Name, age) VALUES ('Tom',25), ('Mark',40), ('Steve',35);

You can run the .tables command to list tables in the database.

sqlite> .tables # List tables in database sqlite> .headers on # Turn on column for printing sqlite> SELECT * FROM employee; # Selecting record from table

Installing SQLite Browser in Ubuntu

Now that we have seen how to install and setup sqlite3 we will also install sqlite browser, a simple GUI tool to manage your sqlite databases.

$ sudo apt install sqlitebrowser -y

You can launch the application from the start menu or from the terminal. To start from the terminal run the following command.

Database Browser for SQLite

Uninstall SQLite and SQLite Browser

Run the following command to remove both SQLite and SQLite browser.

$ sudo apt --purge remove sqlite3 sqlitebrowser

That’s it for this article. If you have any feedback or tips please use the comment section to post it.

Источник

How to install SQLite 3 in Ubuntu 20.04 and Linux Mint 20

SQLite is a free, lightweight, and command-line database application. It is an efficient database engine that is implemented in C. It is a cross-platform database application. Like SQL and MySQL, SQLite is also a relational database. It is widely used in combination with Android and web applications. SQLite is leveraged with an SQLite browser. SQLite Browse is a graphical and free software platform for developing and designing, SQLite databases. In this post, you will get to know the installation procedure of SQLite 3 and SQLite Browser on Linux Mint 20 Ubuntu 20.04.

Читайте также:  Calculate linux нет звука

Installing SQLite 3 in Ubuntu 20.04 and Linux Mint 20

To install SQLite 3 on Ubuntu 20.04 and Linux Mint 20, perform the following steps:

Step 1: Update apt repository cache

Before installing any application or package, it is recommended to update the system apt repository cache using the following command:

Step 2: Update apt-cache

Next, upgrade the apt repository cache using the following command:

Step 3: Install SQLite 3

Alright! Now we are ready to install SQLite 3 on Ubuntu 20.04 and Linux 20. SQLite is available through Ubuntu 20.04 and Linux Mint 20 repositories. Install SQLite 3 using the following command:

Step 4: Verify the installation

After installing SQLite 3, we can view the installed version of SQLite 3. Additionally, it also verifies the installation. Run the below-given command to do so:

Installing SQLite browser in Ubuntu 20.04 and Linux Mint 20

The SQLite browser can be installed in Ubuntu 20.04 and Linux Mint 20 through the below-given steps:

Step 1: Update apt repository cache

Before installing the SQLite browser, update the system’s apt repository cache with the following command:

Step 2: Install SQLite browser on your Ubuntu 20.04 and Linux Mint 20

The SQLite browser can be installed by executing the following command:

The command line will display a prompt. You are supposed to press “y” to continue the installation process. However, if you want to cancel the installation process then press ‘n’ and hit enter.

Step 3: Launch SQLite browser

After the successful installation, click on the application menu and search for SQLite browser and open it.

It is the main window of SQLite bowser.

Removing SQLite 3 from Ubuntu 20.04 and Linux Mint 20

At any point, if you want to remove or uninstall the SQLite 3 from your system, run the following command to do so:

Conclusion

SQLite 3 is a free and efficient database engine. This article explains how to install SQLite 3 on Ubuntu 20.04 and Linux Mint 20.

About the author

Kamran Sattar Awaisi

I am a software engineer and a research scholar. I like to write article and make tutorial on various IT topics including Python, Cloud Computing, Fog Computing and Deep Learning. I love to use Linux based operating systems.

Источник

Оцените статью
Adblock
detector