Categories
Linux Review

Review: Don’t Use Microsoft Teams Preview in Ubuntu 20.04 as of May 2020 until bugs are fixed.

So I have been using teams regularly on Ubuntu 20.04. Things that I noticed were:

  • Mid-call crashes
  • Worst call quality (I could hear the electrons around the atoms)
  • Not being able to find the buttons to control screen (expecting in future)
  • Caused a Mergelist corruption when running apt-get update

TL;DR; I had to UNINSTALL MICROSOFT TEAMS. And I’ll suggest not using teams until it is no longer in Preview

BUT!

This is not why I am posting this. The reason I am posting this is because it messed with my Ubuntu 20.04 system.

I saw a red warning symbol in my notification that said that I was not able to update my system.

apt-get update could not work. Upon inspection, I found this:

codeonion@codeonion-ThinkPad-P50:~$ sudo apt-get update
[sudo] password for codeonion: 
Hit:1 http://ppa.launchpad.net/lutris-team/lutris/ubuntu focal InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                            
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                                                                        
Hit:4 http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu focal InRelease                                                                                                       
Hit:5 http://pk.archive.ubuntu.com/ubuntu focal InRelease                                                                                                                               
Hit:6 http://packages.microsoft.com/repos/vscode stable InRelease                                                                                                                       
Hit:7 http://pk.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                       
Hit:8 https://dl.winehq.org/wine-builds/ubuntu focal InRelease                                                                                                                          
Hit:9 https://download.sublimetext.com apt/stable/ InRelease                                                                                                         
Hit:10 http://pk.archive.ubuntu.com/ubuntu focal-backports InRelease                                           
Hit:11 https://packages.microsoft.com/ubuntu/18.04/mssql-server-2019 bionic InRelease    
Hit:12 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Hit:13 https://packages.microsoft.com/ubuntu/19.10/prod eoan InRelease
Hit:14 https://packages.microsoft.com/repos/ms-teams stable InRelease
Hit:15 https://dbeaver.io/debs/dbeaver-ce  InRelease
Reading package lists... Error!
E: Malformed Description-md5 line; doesn't have the required length (32 != 33) '"129fb0c:f9aeae8e8d848457773b5c4e'
E: Malformed Description-md5 line; doesn't have the required length (32 != 33) '"129fb0c:f9aeae8e8d848457773b5c4e'
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/pk.archive.ubuntu.com_ubuntu_dists_focal_universe_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.

Mergelist problem

E: Malformed Description-md5 line; doesn't have the required length (32 != 33) '"129fb0c:f9aeae8e8d848457773b5c4e'
E: Malformed Description-md5 line; doesn't have the required length (32 != 33) '"129fb0c:f9aeae8e8d848457773b5c4e'
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/pk.archive.ubuntu.com_ubuntu_dists_focal_universe_i18n_Translation-en

The following had to be done to fix this

sudo rm -r /var/lib/apt/lists/*
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get update

It worked partially but apt-get update still gave me a Mergelist problem.

So I had to UNINSTALL MICROSOFT TEAMS

Then, when I ran

sudo rm -r /var/lib/apt/lists/*
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get update

The system got back on its feet, the warning notification disappeared. Looks like until it is in preview, I’ll stick to using Teams on the web only.

Special Thanks to this Gist. @d2s, you are a lifesaver.

Categories
Linux Programming Ruby Shell Script (BASH)

How to Install Ruby 2.7.1 and Rails 6.0.0 in Ubuntu 20.04 Focal Fossa with bash shell script

Ruby logo
Ruby
Ubuntu 20.04 LTS Focal Fossa
Ubuntu 20.04 LTS Focal Fossa

In this post, rbenv is used to install Rails6.0.0 and Ruby2.7.1

First, update your packages

sudo apt-get update

Then Install these prerequisites

sudo apt-get install git -y
sudo apt-get install gcc -y

sudo apt-get install autoconf -y
sudo apt-get install bison  -y
sudo apt-get install build-essential  -y
sudo apt-get install libssl-dev  -y
sudo apt-get install libyaml-dev  -y
sudo apt-get install libreadline6-dev  -y
sudo apt-get install zlib1g-dev  -y
sudo apt-get install libncurses5-dev  -y
sudo apt-get install libffi-dev  -y
sudo apt-get install libgdbm6  -y
sudo apt-get install libgdbm-dev  -y
sudo apt-get install libdb-dev  -y
PackageDescription
GitGit is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GccFor Compilation
autoconfAn automatic configure script builder
bisonA general-purpose parser generator that converts a grammar description for an LALR(1) context-free grammar into a C program to parse that grammar.
build-essential
libsslSecure Sockets Layer toolkit
libyamlA C library for parsing and emitting YAML
libreadline6GNU readline and history libraries, run-time libraries
zlib1gA runtime compression library
libncurses5This is shared libraries for terminal handling
libffiA module to check availability of a library for FFI
libgdbm6GNU dbm database routines
libgdbmGNU dbm database routines
libdbBerkeley Database Libraries for C++
These Prerequisites are now installed your System

Next, we install rbenv itself

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

Install your desired version if ruby

rbenv install 2.7.1

Make the installed version of ruby Global so it can be used everywhere

rbenv global 2.7.1

Finally install Rails 6.0.0 or any supported version you desire and then check its version

gem install bundler -v 2.1.4

ruby -v

gem install rails -v 6.0.0
rails -v

Here is the complete shell script.

#!/bin/bash
sudo apt-get update
echo "--------------"
echo "Prerequisites"
echo "Get updated  Rails prerequisites from https://github.com/rbenv/ruby-build/wiki#suggested-build-environment"
echo "--------------"
sudo apt-get install git -y
sudo apt-get install gcc -y

sudo apt-get install autoconf -y
sudo apt-get install bison  -y
sudo apt-get install build-essential  -y
sudo apt-get install libssl-dev  -y
sudo apt-get install libyaml-dev  -y
sudo apt-get install libreadline6-dev  -y
sudo apt-get install zlib1g-dev  -y
sudo apt-get install libncurses5-dev  -y
sudo apt-get install libffi-dev  -y
sudo apt-get install libgdbm6  -y
sudo apt-get install libgdbm-dev  -y
sudo apt-get install libdb-dev  -y

echo "--------------"
echo "Installing Ruby using rbenv along with its setup"
echo "--------------"

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build


rbenv install 2.7.1
rbenv global 2.7.1

gem install bundler -v 2.1.4

ruby -v

gem install rails -v 6.0.0
rails -v

Furthermore, to uninstall a specific version of Ruby, you can do this

rbenv uninstall 2.7.1
Categories
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- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Register the Microsoft SQL Server Ubuntu repository for SQL Server 2017:
https://packages.microsoft.com/config/ubuntu/20.04/

sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"

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 https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/19.10/prod.list > /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 https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/19.10/prod.list > /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 127.0.0.1 -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:

First

sudo su

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

!/bin/bash
lsb_release -a
sudo apt install software-properties-common -y
sudo apt install curl -y
sudo apt-get update
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
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 https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | 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 127.0.0.1 -U sa -P <YOUR PASSWORD HERE>

Then test the following query

SELECT Name from sys.Databases;
GO

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.

Thanks.

Categories
Programming

Update Knoppix 7.6 from Terminal

So you downloaded Knoppix and realized that it is a little bit rusty. There is a way to make it fresh and update all the packages with two simple commands.

First you need to Refresh the packages database. Go to terminal and type the following command and press enter.

sudo apt-get update

 

This will initiate an activity on the terminal that will download the latest packages information. This will take a few minutes. After the activity finishes, you will have the latest packages information. This is time to Upgrade the packages that are already installed in your Knoppix system to the latest versions that are available in online repositories.

Simply, type in the following command in terminal:

sudo apt-get upgrade

 

This will initiate a download activity on your terminal that will download all the upgradable packages from online repositories. This will take longer than the “update” activity.

At the end, you will have the latest packages installed and you will be running smooth!