How to Install SQLite in Ubuntu Linux using Command Line

Posted on

This article is an article which is used to describe on how to install SQLite. Based on the official website of SQLite which exist in the URL that can be visited in this link, SQLite is defined as an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private.

It is quite easy for installing it in Ubuntu Linux Distribution since the utility for installing a new package, software or utility can be handled by executing command ‘apt-get’. In order to check whether sqlite has been installed or not, just use the command ‘apt list installed | grep sqlite’. It is a command for checking the installed packages or applications in Ubuntu Linux Distribution. The information itself can be associated and it is available in the article in this link titled ‘List Installed Program in Ubuntu Linux using apt command’.

The command executed for installation is shown below :

apt-get install sqlite

And the execution in a real-time condition using the above command for ‘sqlite’ installation is shown below :

root@hostname:~# apt-get install sqlite
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
sqlite-doc
The following NEW packages will be installed:
sqlite
0 upgraded, 1 newly installed, 0 to remove and 70 not upgraded.
Need to get 14,5 kB of archives.
After this operation, 78,8 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 sqlite amd64 2.8.17-12fakesync1 [14,5 kB]
Fetched 14,5 kB in 3s (4.630 B/s)
Selecting previously unselected package sqlite.
(Reading database ... 934373 files and directories currently installed.)
Preparing to unpack .../sqlite_2.8.17-12fakesync1_amd64.deb ...
Unpacking sqlite (2.8.17-12fakesync1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up sqlite (2.8.17-12fakesync1) ...
root@hostname:~#

The execution command of ‘sqlite’ can be shown below :

root@soulreaper:~# sqlite
SQLite version 2.8.17
Enter ".help" for instructions
sqlite> .help
.databases List names and files of attached databases
.dump ?TABLE? ... Dump the database in a text format
.echo ON|OFF Turn command echo on or off
.exit Exit this program
.explain ON|OFF Turn output mode suitable for EXPLAIN on or off.
.header(s) ON|OFF Turn display of headers on or off
.help Show this message
.indices TABLE Show names of all indices on TABLE
.mode MODE Set mode to one of "line(s)", "column(s)",
"insert", "list", or "html"
.mode insert TABLE Generate SQL insert statements for TABLE
.nullvalue STRING Print STRING instead of nothing for NULL data
.output FILENAME Send output to FILENAME
.output stdout Send output to the screen
.prompt MAIN CONTINUE Replace the standard prompts
.quit Exit this program
.read FILENAME Execute SQL in FILENAME
.schema ?TABLE? Show the CREATE statements
.separator STRING Change separator string for "list" mode
.show Show the current values for various settings
.tables ?PATTERN? List names of tables matching a pattern
.timeout MS Try opening locked tables for MS milliseconds
.width NUM NUM ... Set column widths for "column" mode

sqlite>

As shown in the above command execution of ‘sqlite’ command which is actually working, it shows that the installation of ‘sqlite’ has already been succeeded.

Leave a Reply