Thursday, October 31, 2019

Linux Setup Cheat Sheet II

In the previous post, we discussed various options to set up Ubuntu Linux. Now let's install some software.
Let's check it out!

General
First, let's list some general purpose commands that can be applied + executed anywhere. Launch Terminal:
 Command  Description
 hostname  Confirm host computer name
 whoami  Confirm user executing command
 sudo su  Run as administrator
 sudo apt-get update  General all-purpose update
 sudo apt-get -f install  Install outstanding packages
 sudo dpkg -i *.deb  Install any Debian package
 sudo tar -xvzf *.tar  Extract tar ball [tape archive] file
 sudo add-apt-repository *  Add package to repository
 sudo add-apt-repository --remove *  Remove package repository
 shutdown -r now  Shuts down Ubuntu Linux

Java
By default, Java may not be installed but is a good idea to install because a lot software may be dependent. Launch Terminal and enter the following commands:
sudo apt install openjdk-11-jre-headless  # version 11.0.3+7-1ubuntu2~19.04.1, or
sudo apt install default-jre              # version 2:1.11-71
sudo apt install openjdk-8-jre-headless   # version 8u212-b03-0ubuntu1.19.04.2
sudo apt install openjdk-12-jre-headless  # version 12.0.1+12-1
sudo apt install openjdk-13-jre-headless  # version 13~13-0ubunt1

Repeat if you would like to install javac but install JDK this time instead of JRE. Enter these new commands:
sudo apt install openjdk-11-jdk-headless  # version 11.0.3+7-1ubuntu2~19.04.1, or
sudo apt install default-jdk              # version 2:1.11-71
sudo apt install openjdk-8-jdk-headless   # version 8u212-b03-0ubuntu1.19.04.2
sudo apt install ecj                      # version 3.16.0-1
sudo apt install openjdk-12-jdk-headless  # version 12.0.1+12-1
sudo apt install openjdk-13-jdk-headless  # version 13~13-0ubunt1

Various
Here is a list of general software applications that I believe are handy to have installed. Launch Terminal:
sudo apt-get install git
sudo apt-get install subversion
sudo apt-get install curl
sudo apt-get install python
sudo apt-get install python3

Browser
Download Google Chrome as default browser. Save *.deb file in Downloads folder and install from Terminal:
cd ~/Downloads
sudo dpkg -i google-chrome-stable_*.deb
By default, certain packages may not be installed for this software. If this is true then enter the commands:
sudo apt-get update
sudo apt-get install libgconf2-4
sudo apt-get install libnss3-1d
sudo apt-get install libxss1
sudo apt-get -f install

Source Control
In the previous post, we setup a folder share and made it possible to copy + paste files across from host to virtual machine. However, it may be easier to install source control client to simply pull + push files directly.

GitEye
Download GitEye is available completely free but only includes very limited features. Good for starting point:
cd ~/Downloads
mkdir GitEye
mv GitEye*.zip GitEye
cd GitEye
unzip GitEye*.zip
rm GitEye*.zip
./GitEye

SmartGit
Download SmartGit as full-featured and similar product to SourceTree but it requires a commercial licence:
cd ~/Downloads
tar -xzvf smartgit*.tar.gz
rm smartgit*.tar.gz
cd smartgit/bin
./smartgit.sh

GitKraken
Download GitKraken as a great compromise. This software is full-featured like SourceTree available for free: Note: GitKraken can launch Terminal [a handy feature] but seems only from using Alt+T keyboard shortcut.
cd ~/Downloads
sudo dpkg -i gitkraken*.deb

IDEs
Now we'd like to build our own software so let's install various Integrated Development Environments [IDEs].

VS Code
Visual Studio Code is a popular lightweight IDE available cross platform on Windows, Mac OS/X and Linux. Install directly from Ubuntu Software. Otherwise, launch the Terminal and enter the following commands:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

sudo apt-get update
sudo apt-get install code # or code-insiders
Note: if there's an issue with Visual Studio Code install then try sudo apt-get --fix-broken install + try again.


Geany
Geany is a lightweight IDE using the GTK2 toolkit and may seem to be popular for C development on Linux. Launch Terminal and enter the following commands:
sudo add-apt-repository ppa:geany-dev/ppa
sudo apt-get update
sudo apt-get install geany geany-plugins-common

Code Blocks
Code Blocks seems to be popular IDE for Sega Genesis development. Install directly from Ubuntu Software.


CLion
CLion is a commercial IDE from JetBrains for C/C++ available cross-platform on Windows, Mac OS/X and Linux using CMake build system. Download CLion. Launch Terminal and enter these following commands:
cd ~/Downloads
tar -xvzf CLion-*.tar.gz
cd CLion*
cd bin
./clion.sh

Dotnet
Specifically .NET Core is now open source and available cross platform on Windows, Mac OS/X and Linux! Launch Terminal and enter the following commands:
wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

# Install .NET Core Runtime
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-hosting-2.0.6

# Install the .NET SDK
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

# Verify installation
dotnet --version
dotnet --list-sdks
dotnet --list-runtimes
IMPORTANT
If you receive an error message similar to Unable to locate package dotnet-sdk-2.2 then refer to this guide.


Miscellaneous
After installing IDEs for C/C++ let's install a static code analysis debugging and profiling tool like Valgrind:
sudo apt install valgrind
# Example "HelloWorld"
cd ~/CLionProjects/HelloWorld/cmake-build-debug
valgrind ./HelloWorld --lead-check=yes

Also, if you would like to take a screenshot then use [Alt +] PrintScr to save in output ~/Pictures directory.


Games
Finally, let's install some emulators in order to play + test 8-bit and 16-bit SEGA retro video games on Linux.

Kega Fusion
Download Kega Fusion as emulator for general Sega retro video games. Launch Terminal + run commands:
cd ~/Downloads
sudo dpkg -i Kega-fusion_3.63-2_i386.deb
sudo apt-get -f install

Gens GS
Download Gens GS as emulator for Sega Genesis retro video games. Launch Terminal and run commands:
cd ~/Downloads
sudo apt-get update
sudo dpkg -i Gens_2.16.7_i386.deb
sudo apt-get -f install

Emulicious
Download Emulicious as emulator for Sega retro video games with great debugger! Launch Terminal + run:
cd ~/Downloads
mkdir Emulicious
mv Emulicious.zip Emulicious
cd Emulicious
sudo unzip Emulicious.zip
rm Emulicious.zip
java -jar Emulicious.jar

Doom
Finally, there is an awesome YouTube video documenting how to setup Doom on Linux. All notes found here!


Summary
Now we have Ubuntu installed with a ton of Ubuntu software we are in a good spot to progress with Linux. Being open source it is also possible to modify the Linux kernel which would be a phenomenal next step!