Programming Shell Script (BASH) SQL

Install SQL Server 2019 in Ubuntu 20.04 LTS

Learn how to Install SQL Server 2019 in Ubuntu 20.04 LTS. Lets just start straightaway. While it is a straightforward process in Microsoft Windows operating system, it is different in Ubuntu (or Debian based supported distributions).

If you are in a rush and/or are too pro to skip this, I have also provided a Shell script. The shell script can be found HERE! but I recommend reading this post to make sure nothing is skipped and the installation of Microsoft SQL Server 2019 goes smoothly.

codeonion:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal

Lets Begin Installation of Microsoft SQL Server 2019 in Ubuntu 20.04

Install software-properties-common

sudo apt install software-properties-common
sudo apt-get update

Import the public repository GPG keys:

wget -qO- | sudo apt-key add -

Register the Microsoft SQL Server Ubuntu repository for SQL Server 2017:

sudo add-apt-repository "$(wget -qO-"

Install Microsoft SQL Server 2019 in Ubuntu

sudo apt update
sudo apt install mssql-server

We are recommended to run a command

So lets run it
sudo /opt/mssql/bin/mssql-conf setup

Pick your Microsoft SQL Server 2019 Edition

When prompted, accept the license and then set up a PASSWORD

Confirm Microsoft SQL Server 2019 Active Status

systemctl status mssql-server.service 

Should show active running database server

Install Microsoft SQL TOOLS mssql-tools

Lets now install mssql-tools. But first!! Acquire the power of Sudo Su!

sudo su

This breaks all the walls and lets you do whatever the crap you want. So be careful :). Now do the following.

curl | sudo apt-key add -
curl > /etc/apt/sources.list.d/mssql-release.list
sudo apt update 
sudo ACCEPT_EULA=Y apt install mssql-tools unixodbc-dev

Configure PATH for MS SQL binaries

curl | sudo apt-key add -
curl > /etc/apt/sources.list.d/mssql-release.list
sudo apt update 
sudo ACCEPT_EULA=Y apt install mssql-tools unixodbc-dev

Now connect to your server using

sqlcmd -S -U sa -P <yourpassword>

Shell Script to Install Microsoft SQL Server 2019 in Ubuntu 20.04

Finally, I will be an ass if I didn’t make a shell script of this process so:


sudo su

Then run the following shell script (replace your password at the bottom of the script)

lsb_release -a
sudo apt install software-properties-common -y
sudo apt install curl -y
sudo apt-get update
wget -qO- | sudo apt-key add -
sudo add-apt-repository "$(wget -qO-"
sudo apt-get update
sudo apt-get install -y mssql-server
sudo /opt/mssql/bin/mssql-conf setup
systemctl status mssql-server --no-pager
curl | sudo apt-key add -
curl | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev -y
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
sqlcmd -S -U sa -P <YOUR PASSWORD HERE>

Then test the following query

SELECT Name from sys.Databases;

And you will see:

That may be the end of it. Let me know if it helped. Please comment and share if it helped. Lets us know.



Install and run XAMPP on Windows and Linux

In this basic tutorial, you will learn how to install XAMPP. XAMPP is used to run Apache HTTP Server, MySQL database, and interprets scripts written in the PHP. It is a great tool to test or host a website on your own machine. Lets see how install and start it.

  1. Download and Install.
    • Install for Windows here
    • Linux (Knoppix mainly) Installation here and Please follow that guide only if you are Linux User.
  2. Now run the program.
  3. The control panel will open. You need to start the Apache and MySQL services and make sure that they are green.



Now, all you need to do is the browse to the installation folder of XAMPP and get to the htdocs folder. Assuming you installed XAMPP in c:\ then look for the following path.


Now make a folder named mywebsite inside the htdocs folder and inside it, make a file named index.php like this.


Open and edit the index.php file and add the following code.


echo "XAMPP has been installed and PHP is working fine".


Now, go to your browser, and visit one of the following links.

If you see the message in the above code. then you have not only installed XAMPP but you are now able to work with PHP.


Knoppix touchpad click workaround

Problem: I can’t click with my touchpad in Knoppix. I can use USB/bluetooth mouse normally but the Laptop’s touchpad can’t be tapped to click.


  1. Go to terminal and enter the following

    knoppix@Microknoppix:~$ synclient Tapbutton1=1

  2. Now try closing the terminal by tapping the [X] in the terminal window and it will work.

Note: This only works for the current session which means if you restart knoppix, the touchpad will be back to unclickable. I will update the post as soon as I discover the permanent solution to the problem. But as far as I am concerned, I can do that on every boot 🙂



Installing, running and testing and stopping Xampp services in Knoppix

Knoppix is very portable and easy to use. Being a developer, I know that it is important to keep your tools handy.  This post is about installing Xampp in Knoppix. The following steps can get it running in no time ;D

  1. Get the latest .tar.gz of Xampp and download it in a folder.
  2. Go to the downloaded file’s folder using File Manager.
  3. Open Terminal in the .tar.gz file’s folder by pressing

    Tools>Open Current Folder in Terminal

The next step will Install Xampp in /opt folder.

  1. Type the following command in the terminal (make sure the name of the .tar.gz file is correct)

…:~$ sudo tar xvfs NAME OF FILE.tar.gz -C/opt

Afterwards, you will see a lot of installation activity in the terminal window. When it finishes, it is necessary to change permissions to the htdocs folder in xampp in order to make development easy and possible.

  1. Type the following in Terminal to allow file permissions in htdocs

…:~$ chmod 777 /opt/lampp/htdocs

  1. Now we can start Xampp

…:~$ /opt/lampp/lampp start

  1. Now go to browser and type localhost and it will be working fine. Also check if phpmyadmin is working.
  1. To stop Xampp services, go to terminal and type this

…:~$ /opt/lampp/lampp stop

  1. Enjoy! 🙂



Installing WINE in knoppix (CD and DVD)

Wine in Knoppix CD version

Type the following in Terminal

knoppix@Microknoppix:~$ sudo apt-get update

It will download and install wine along with its required repositories. Afterwards, you can install Wine by typing sudo apt-get install wine1.5.

knoppix@Microknoppix:~$ sudo apt-get install wine1.5

Afterwards, if you with to install a Windows program in Knoppix, then simply copy the setup on the desktop (makes it easy) and then click the setup file. If everything was set properly, then Wine will appear to install the program. It is important to note that some programs require some files (such as .dll files) which are mostly provided in Windows but not in Linux. Therefore it is important that those files are to be copied in the required folders.

Wine in Knoppix DVD version

As for those users of Knoppix who intend to use the DVD version, then there is no need to install anything because Wine comes as a pre-installed package in the DVD version.