Prerequisites
Before installing SQLite 3on WSL, please ensure you have WSL enabled on your Windows 10 system.
Follow Install Windows Subsystem for Linux on a Non-System Drive to install WSL on a non-C drive.
This tutorial provides steps to install SQLite 3 on WSL Debian distro. You can follow similar steps to install it in other Linux distros.
Step by step guide
Open Debian distro through WSL command:
wsl -d Debian
Update Debian packages:
sudo apt update
You need to type user password.
Install SQLite 3 using the following command:
sudo apt install sqlite3
Type Y to continue when asked.
Wait until the installation is completed.
Verify SQLite version:
$ sqlite3 --version 3.16.2 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209
Test SQLite 3
Create a database named test.db using the following command:
sqlite3 test.db
The command outputs the following:
SQLite version 3.16.2 2017-01-06 16:32:41 Enter ".help" for usage hints. sqlite>
Check database list using the following command:
sqlite> .databases
The output looks like the following screenshot:
3. Type .exitto exit the CLI.
4. Run command ls and you will find the file database is created.
```
$ ls
test.db
```