Installing OS and some useful software

Updated in March, 2020,
mostly applicable to Ubuntu Linux 19.04 desktop 64-bit

OS installation

Ubuntu Linux ISO file can be downloaded from releases.ubuntu.com.

It would be reasonable to check the integrity of the downloaded ISO before installation, but, let's be honest: many people skip this step and go directly to Live USB creation. Anyway, think for yourself.

Checking archive integrity

If you want to make sure that the downloaded ISO is good, you should also download the corresponding SHA256SUMS and SHA256SUMS.gpg files, put all three to the same directory, and exec following cmd (sha256sum is included in the Coreutils pkg which is always installed):

sha256sum -c SHA256SUMS 2>&1 | grep OK

The output should be like:

ubuntu-19.04-desktop-amd64.iso: OK

Of course, it will be 'OK' only if the calculated hash matches the hash from SHA256SUMS file.

An alternative method (no need to download SHA* files):

sha256sum ubuntu-19.04-desktop-amd64.iso

You are supposed to get a single line that looks like:

2da6f8b5c65b71b040c5c510311eae1798545b8ba801
c9b63e9e3fd3c0457cbe *ubuntu-19.04-desktop-amd64.iso

Compare this calculated hash with the corresponding hash in the SHA256SUMS file (you can open that file on the web-site). If it's exactly the same, then ISO is OK. Otherwise, you should probably try to download from another site/mirror.

The same approach can be used to check any downloaded files/archives (if, of course, developers provide the appropriate files). See, for example, Maven.

I usually do this

The standard Ubuntu desktop installation procedure is quite simple if you stick to defaults. And in most cases you should, - save your time, leave non-standard stuff to experts with special requirements.

When I install a new Linux version on SSD, the first thing I do after installation is a std set of config modifications for the Solid State Drive.

Then, of course, the latest updates. See apt upgrade.

And since my favorite file manager is Midnight Commander,

sudo apt install mc

Also, I usually install:

sudo apt install nmap

sudo apt install openssh-server

However, if you don't know what is nmap, you probably don't need it. And if you're not planning to connect to your system remotely using ssh, then you don't need SSH server.

If you prefer the old stuff like ifconfig and traceroute (both are not installed by default in latest Linux versions), read (!) about net-tools, try ip, mtr, nmcli and then, if you still want it:

sudo apt install net-tools

sudo apt install traceroute

Now comes the moment when I configure mDNS and firewall.

Of course, if your computer is connected to a large corporate network, or if your computer is the only device in your home net (besides router providing Internet connection), then you most likely don't need mDNS.

Linux firewall is the part of the kernel, you don't have to install it, it's already there. But you must configure it, and this is a separate story (see iptables unless you prefer some other tool). Without firewall properly configured I feel uncomfortable, though some people don't care about it at all, and nothing happened (so far).

Next step is optional - development tools:

sudo apt install build-essential

Not everybody needs this, but some people, including me, feel helpless without gcc, make, JDK (which is not included in the above package), Maven (also not included).

Developers usually need git

In the past the pkt was git-core, but now it's just git:

sudo apt install git

and try

git --version

But this is not all, you should configure it:

git config --global user.name "username"

git config --global user.email "name@domain"

--global means that param is used for all your projects. To see current config:

git config --list

To avoid merge commits for pulling:

git config --global branch.autosetuprebase always

By default, Git uses the system default editor set by VISUAL or EDITOR env vars. If there is no system default, or you don't like it, set your own. The following example sets vim:

git config --global core.editor vim

There are many other config params you can set.

Hardware monitoring / Sensors

I always install hddtemp (because I care about my SSDs and HDDs):

sudo apt install hddtemp

Other sensors can be useful too:

sudo apt install lm-sensors psensor

Audio, video, codecs

Last Ubuntu versions (since 18.xx?) can install codecs in the process of OS installation - just click the appropriate checkbox. If you missed that point:

sudo apt install ubuntu-restricted-extras

It comes with Microsoft true-type fonts. If due to some strange reasons you don't want codeks, but want Microsoft TTF, do:

sudo apt install ttf-mscorefonts-installer

Cmdline audio player mpg123 is good for use in scripts and to play music on the background, or to cut fragments from MP3 files:

sudo apt install mpg123

My default MP3 player is audacious. Probably there are better alternatives, but I want to keep it simple:

sudo apt install audacious

When I want to convert WAV files to MP3, I use lame:

sudo apt install lame

My favorite video player is MPlayer:

sudo apt install mplayer smplayer

Many people prefer VLC:

sudo apt install vlc vlc-plugin-pulse mozilla-plugin-vlc

When it comes to video editing, I use FFmpeg:

sudo apt install ffmpeg

The above cmd installs release 4.1.3 (Ubuntu 19.04, 2019, Aug). Alternatively, you can download the latest statically built version of FFmpeg from John Van Sickle site. The installation procedure is simple: unpack archive to some empty dir and copy executable(s) to /home/bin (personal use) or to /usr/local/bin, check/adjust mode and ownership.

Video : graphics cards

If during system installation you checked that checkbox (codecs, third-party software, etc), then the proprietary driver for your nVidia graphics card (if you have one) was probably installed automatically. To check what graphics cards are installed in your computer, try this:

lspci -k | grep -A 2 -i "VGA"

To detect card model, vendor, available drivers, recommended driver:

ubuntu-drivers devices

To install drivers:

sudo ubuntu-drivers autoinstall

To install a specific nVidia driver:

sudo apt install nvidia-driver-418

There is also a useful GPU benchmarking app that estimates your system:

sudo apt install glmark2

It takes several minutes to calculate your average score. On my [quite old] system with GeForce GTX 650, 4.6.0 NVIDIA 418.56 driver, it took ~8min, and glmark2 score was 3240.

Tweaks, gnome-extensions

Practically everybody nowdays installs Tweaks and Gnome-extensions:

sudo apt install gnome-tweaks

sudo apt install gnome-shell-extensions

sudo apt install chrome-gnome-shell

(in the past gnome-tweaks was gnome-tweak-tools)

The second cmd installs a subset of Gnome shell extensions, but unfortunately it does not install "Dash-to-dock" (as of Ubuntu 19.04). Some people say dash-to-dock is not compatible with Ubuntu 19.04. However, I've installed it somehow, after several attempts, with multiple warnings and error messages. And it works good.

The third cmd installs "Gnome shell host connector". I'm not sure what this is, but probably it's important - even if you use Mozilla Firefox instead of Google Chrome.

There is also another popular "tweak": if you want to minimize windows by clicking on their icons in the Ubuntu Dock, run the following cmd:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

Themes

There are three types of themes:

You can install themes using an appropriate *.deb pkg, or download archives from GNOME Look website.

To use the themes of your choice, make sure you have 2 hidden subdirs in your home dir:

You can create these dirs with the following cmds:

mkdir ~/.themes

mkdir ~/.icons

But this is not enough. The next step: open Tweaks -> Extensions and set User themes "ON". Now you can move themes in those hidden dirs and use Tweaks -> Appearance to configure your unique "Look & Feel" (assuming you've already downloaded something).

When you download the archived version of GTK or GNOME Shell theme, unpack it and copy the extracted folder to .themes. If you download archived version of icon theme, unpack it and copy the extracted folder to .icons.

Note!

The downloaded archive can include multiple themes, and it's not enough to unpack it and move the whole unpacked dir to destination - you should copy/move each theme separatley. A typical theme installed in .themes includes subdirs like gtk-3.0 or gnome-shell, while a typical icon theme installed in .icons includes subdirs like actions, animations, apps, etc.

Some interesting themes

I like latest Mac OS themes (e.g., 'McOS-MJV-Dark-mode-Gnome-3.30', 'McOS-shell-Space-Grey') from www.gnome-look.org.

La Capitaine is an icon pack designed to integrate with most desktop environments. The set of icons takes inspiration from the latest iterations of macOS and Google's Material Design through the use of visually pleasing gradients, shadowing, and simple icon geometry. Every image in this theme is a scalable vector graphic so it will look great at any size, on any screen. In my spare time, I work on adding new icons, updating old ones, and making this theme more complete. Since this theme is updated often, you should clone this git repository and pull regularly to make sure you're always up-to-date:

sudo add-apt-repository ppa:dyatlov-igor/la-capitaine

sudo apt update

sudo apt install la-capitaine-icon-theme

or

cd ~/.icons

git clone https://github.com/keeferrourke/la-capitaine-icon-theme.git

Flat Remix:

sudo add-apt-repository ppa:daniruiz/flat-remix

sudo apt-get update

sudo apt-get install flat-remix-gnome

Flat Remix / terminal inst:

cd /tmp && rm -rf flat-remix-gnome-theme && git clone https://github.com/daniruiz/flat-remix-gnome && mkdir -p ~/.themes && cp -r /tmp/flat-remix-gnome/Flat-Remix* ~/.themes && gsettings set org.gnome.shell.extensions.user-theme name "Flat-Remix";

Java, JRE, JDK

After Oracle Java licensing policy was changed in April of 2019, old-style Oracle Java installation does not work anymore. You still can install and use Oracle Java, but there are many limitations, some things that were free, now must be paid for. So, many people decided to move to Open JDK. Technically, it's also Oracle Java, but so far it's free.

FYI:
Java 9, Java 10 are short-lived, transient versions.
Java 8, Java 11 are LTS (long-term support) versions.

Ubuntu installation is simple. If you are not a Java developer, the following minimum pkg will be probably enough (unless your app is JavaFX, see below!):

sudo apt install default-jre

For Java developers:

sudo apt install default-jdk

JDK includes JRE, you don't have to install it specifically. Default JDK in case of Ubuntu 19.04 (and Ubuntu 18.xx?) is Java 11, and you can also install it with the following cmds:

sudo apt install openjdk-11-jre

sudo apt install openjdk-11-jdk

To make sure it works, try:

java -version

javac -version

When you install Open JDK in Ubuntu Linux, the procedure creates the appropriate symlinks in /usr/bin, so you don't have to modify your PATH to run java or javac (though you may need it for some other Java-related tools).

If you specifically need Java 8:

sudo apt install openjdk-8-jre

sudo apt install openjdk-8-jdk

And here comes the problem. Unlike Oracle Java 8, Open JDK does not include JavaFX libraries, and any attempt to run JavaFX app ends with

Error: Could not find or load main class ...

Maybe it happened because I've installed openjdk-8-jdk-headless? Anyway, modularization of JDK is the current trend, so, don't waste your time on experiments. The best way to move forward is to install these libraries:

sudo apt install openjfx

JavaFX version must correspond to Open JDK/JRE version, and in Ubuntu 19.04 the above cmd installs JavaFX libs for Java 11. I've tried to find JavaFX for Open JDK 8 - no success (though I've heard it exists somewhere).

The second important point: to start JavaFX app in this modular environment, you need more complicated cmdline. Here is a BASH script I use now to run my JavaFX app that was built with old Oracle Java 8:

#!/bin/bash

# The old cmdline was:
#    java -jar MyJavaFxApp.jar

MODULE_PATH=/usr/share/openjfx/lib
ADD_MODULES=javafx.base,javafx.controls,javafx.fxml

# ADD_MODULES=javafx.base,
#             javafx.controls,
#             javafx.fxml,
#             javafx.graphics,
#             javafx.media,
#             javafx.swing,
#             javafx.web

java --module-path $MODULE_PATH --add-modules=$ADD_MODULES
      -jar MyJavaFxApp.jar

(the java ... cmd must be a single line)

It's assumed that this script is started in the directory where the JAR file resides. Also, other apps may require additional modules.

The bad news for Android developers: Android Studio up to v3.4.x requires Java 8. But this is not a big problem, because Android Studio comes with its own Java! And this "special android" Java (Java 8, to be exact) does not interfere with Open JDK.

The good news for Spring developers: Spring Boot 2.1+ and Spring Framework 5.1+ support Java 11. Of course, you will have to modify your pom.xml files, upgrade the Maven Compiler plugin to 3.5+ version, etc.

To switch Java versions, if you have several of them installed, run:

sudo update-alternatives --config java

Some apps need JAVA_HOME env var. You can set it [system-wide] using the following cmd:

echo -e 'export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"' | sudo tee /etc/profile.d/jdk11.sh

or you can manually create the appropriate file in /etc/profile.d; it does not have to be jdk11.sh, but the name must be reasonable (I wouldn't call it "java.sh", however):

export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"

Note that it will be activated after you log out/in, or after system restart.

Installing third-party JAR libraries

To install [system-wide] a third-party Java lib (file jssc.jar is used here as an example):

Apache Maven

(note that version 3.6.1 is used here as example)

The installation of Apache Maven is a simple process of extracting the archive and adding the /usr/local/maven/bin to the PATH (it's assumed that JDK is already installed and JAVA_HOME is set). You should do the following:

Alternatively, you can move the whole unpacked dir apache-maven-3.6.1 to /usr/local and create a symlink:

ln -s apache-maven-3.6.1 maven

The last approach is good if you're going to keep several versions of Maven.

After this you should add /usr/local/maven/bin to your PATH and try:

mvn --version

Note!

It's a good practice to check the integrity of the downloaded archive before installtion!

To make sure that you've downloaded exactly what you were intended to download, you must download three files:

  apache-maven-3.6.1-bin.tar.gz
  apache-maven-3.6.1-bin.tar.gz.asc
  apache-maven-3.6.1-bin.tar.gz.sha512

Put all three files to the same directory, and exec following cmd:

sha512sum -c apache-maven-3.6.1-bin.tar.gz.sha512 2>&1 | grep OK

The output must be:

apache-maven-3.6.1-bin.tar.gz: OK

Note that in this case we use sha512sum because hash file is sha512.

Node.js

To install LTS (long term support) stable release of node.js:

sudo apt install nodejs

sudo apt install npm

For Ubuntu 19.04 it's supposed to be node.js version 10.x. The newer version you can get from node.js PPA. Make sure you have curl (install it, if not):

sudo apt install curl

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

sudo apt update

sudo apt install nodejs

In this case the last cmd is supposed to install both node and npm. See details, doc, etc at nodejs.org/en/download.

I've used the first approach and installed version 10.15.2. But an attempt to run npm caused a verbose warning starting with "...npm does not support Node.js v10.15.2..." (probably it was some temporary repository inconsistency). Experts' advice for this situation:

npm -v

sudo npm install npm@latest -g

then restart shell (close/open Gnome terminal) and make sure you really have newer version:

npm -v

It worked for me (Ubuntu 19.04, 2020-Feb-27).

APC UPS support

UPS software for those who has APC BackUPS, SmartUPS, etc:

sudo apt install apcupsd apcupsd-cgi

Pay attention to the following settings in /etc/apcupsd/apcupsd.conf:

UPSNAME apc650
UPSCABLE usb
UPSTYPE usb
# DEVICE /dev/ttyS0
...
# BATTERYLEVEL 5
BATTERYLEVEL 20
# MINUTES 3
MINUTES 5
# TIMEOUT 0
TIMEOUT 300

The apcupsd-related web-apps reside in /usr/lib/cgi-bin/apcupsd/. If you have Apache2 web-server correctly configured and running, you can access APC UPS status info (current line voltage, battery capacity, UPS load, etc) using the link http://localhost/cgi-bin/apcupsd/upsstats.cgi.

Miscellaneous installation commands

Probably, you won't need this. But it can be useful in some situations.

Codecs:

apt-get install libavformat-extra-53 libavcodec-extra-53

Media players:

sudo apt-get install mplayer smplayer mencoder gnome-mplayer

sudo apt-get install vlc vlc-plugin-pulse mozilla-plugin-vlc

sudo apt-get install mpg321

sudo apt-get install audacious

Most codecs you might need can be found in the ubuntu-restricted-extras, but if you want to play encrypted DVDs, you must install some packages from the Medibuntu repository. See Playing encrypted DVDs.

JACK Audio Connection Kit:

sudo apt-get install jack jackd jackeq

LMMS, Linux MultiMedia Studio, DAW (Digital Audio Workstation) for music creation and recording:

sudo apt-get install lmms

Low Latency Kernel. Do not install (!) it unless you really need it, the majority of people don't need it at all:

sudo apt-get install linux-lowlatency

If you don't need it, you can remove it:

sudo apt-get remove linux-lowlatency

Adobe Flash plugin:

sudo apt-get install flashplugin-installer

miniDLNA, simple media server, can be used to watch on Smart TV (or other devices, like tablet or smartphone) movies (VOB, MP4, AVI) stored on this computer:

sudo apt install minidlna

Software development tools

The most important build tools (gcc, make, libc6-dev, etc):

sudo apt install build-essential checkinstall

Note! checkinstall is only required if you want integrate into pkg manager a new pkg built from source.

The following pkgs are required if you want to get source code from projects with no released version:

sudo apt install cvs subversion git-core mercurial

If you want to build from source create /usr/local/src dir with the appropriate access rights for the main user (yourself). If you downloaded from source such as Git, SVN, or any other source repository then it is likely that the ./configure files have not yet been generated. You may be able to run the command:

autogen.sh

from within the downloaded files top directory. This cmd relies on automake and autoconf and will automatically build the configuration files and run ./configure.

Note that:

sudo apt-get build-dep pkg

means "as root, install all dependencies for pkg required to build it".

Other development tools and libraries (some pkgs may be already installed with build-essential):

sudo apt-get install g++

sudo apt-get install ia32-libs

sudo apt-get install ldap-utils

sudo apt-get install libldap*

sudo apt-get install indent

sudo apt-get install git-core

sudo apt-get install libgtk2.0-dev

sudo apt-get install libgtkmm-3.0-dev

sudo apt-get install libgtkmm-2.4-dev

sudo apt-get install lib3ds-dev

sudo apt-get install cmake cmake-gui

sudo apt-get install libserial-dev

sudo apt-get install libssl-dev

sudo apt-get install liblzo2-dev

sudo apt-get install libgstreamer*

sudo apt-get install sqlite3

sudo apt-get install libsqlite3-dev

sudo apt-get install php5-sqlite3

sudo apt-get install postgresql postgresql-contrib   (PostgreSQL, server + client)

sudo apt-get install postgresql-client   (PostgreSQL, client only)

sudo apt-get install python-psycopg2   (PostgreSQL, python)

sudo apt-get install freetds-bin freetds-dev   (MS SQL Server, python)

sudo apt-get install python-dev python-pip   (MS SQL Server, python)

sudo pip install pymssql   (MS SQL Server, python)

sudo apt-get install python-numpy   (python pkg for scientific computing)

Misc apps, tools and utilities

sudo apt-get install traceroute

sudo apt-get install iftop

sudo apt-get install iptraf iptraf-ng

Utilities todos, fromdos - Ubuntu replacement for classical dos2unix, unix2dos:

sudo apt-get install tofrodos

Pandoc, a Haskell library for converting from one markup format to another, and an appropriate cmdline tool:

sudo sudo apt-get install pandoc

Usage example, converting README.md to readme.html:

pandoc -o readme.html README.md

Graphics packages:

sudo apt-get install gimp

sudo apt-get install inkscape

sudo apt-get install blender

Scanner support:

sudo apt-get install xsane

Compress/decompress tools:

sudo apt-get install p7zip-rar p7zip-full unace unrar zip unzip sharutils rar uudeview mpack arj cabextract file-roller

Synaptic, a graphical package management program for apt. It provides the same features as the apt-get command line utility with a GUI front-end based on Gtk+:

sudo apt-get install synaptic

Tor browser:

sudo apt install torbrowser-launcher

If it complains about missing canberra-gtk-module:

sudo apt install libcanberra-gtk-module

Note that Tor browser keeps some files (e.g., downloads) in the hidden dirs within $HOME/.local/share/....

Games

Installing joystick:

sudo apt install xboxdrv

sudo apt install joystick

sudo apt install js-test-gtk

Playing encrypted DVDs

If you want to play encrypted DVDs, you must install some packages from the Medibuntu repository. To enable this rep, enter this long cmd:

sudo -E wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

Once Medibuntu is set up:

sudo apt install non-free-codecs libdvdcss