Ubuntu 18.04 Install Guide

Share:

Ubuntu 18.04 LTS is a fantastic OS for general use. Here is a guide with the shell commands for installing it and customizing it.

Steps

  1. Back up files
  2. Make sure back ups work
  3. Make boot USB thumb drive with OS image
  4. Boot from USB drive
  5. Install OS
  6. Configure OS
  7. Install software

1. Back up files

My important files are stored on remote servers and backed up on local external drives to avoid lossing anything.

2. Make sure back ups work

It may seem obvious but its worthwhile to actually test that your most important files actually are backed up and didn't get corrupted or become otherwise inaccessible. I tend to just make important directories are the same size and try opening a few random files, or a few particular very important ones.

3. Make boot USB thumb drive with OS image

You can use any thumb drive with 2GB or more storage. See official tutorial on how to do this here.

4. Boot from thumb drive

On Sager NP7851 I had an issue with the Nvidia drivers and GRUB settings similar to the bug reported here. The proposed fix did work for me:

  1. Disable Fast Boot and Secure Boot (or Secure loader).
  2. Plug in the bootable USB with the Linux distro (mine was Ubuntu 18.04)
  3. When you see the loader to “Install Ubuntu” etc … press “e” and edit a line: Replace “quiet splash” to “nomodeset” and press F10 to boot. Then after the installation is complete, you will have to reboot.
  4. This time you will now encounter the GRUB. Again, press “e” and edit a line: In the line that starts with “linux”, add nouveau.modeset=0 at the end of that line.

5. Install OS

You can now choose Install Ubuntu from the GRUB list and follow the install guide. You can also choose to encrypt your hard drive with a password. You do have to enter this password each time you boot up your computer and there is a performance hit however. Think carefully about using it. Follow the installation guide to configure users, passwords, and whatnot and you should have your new OS up and running soon.

6. Configure OS

Connect to your network now if you can because now is a good time to update your system:</p>

sudo apt-get update
sudo apt-get upgrade
sudo apt autoremove

Now intall the Ubuntu Restricted Extras for media codecs (.mp3 etc):

sudo apt install ubuntu-restricted-extras

Disable touchpad with synclient

sudo apt-get install synclient

add this line to .bashrc: synclient TouchpadOff=1

BIOS settings

Hit F2 to enter BIOS (should already know this) and select the XMP memory profile, enable fast boot, and the other chipset features

Remove GRUB boot delay

Edit the grub config at: /etc/default/grub . Set GRUB_TIMEOUT=0 to not show the menu and directly boot.

Add bugfix Kernel parameters

Edit the grub config: /etc/default/grub . See here how to edit your GRUB . Then start with and add cumulatively to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Disable GPE

Known bug in Intel chips running Linux: https://bugzilla.kernel.org/show_bug.cgi?id=117481#c23. For fix info see here.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_block_gpe=0x6F"
Disable dynamic USB power management in kernel

https://askubuntu.com/questions/1044872/ubuntu-16-04-kworker-using-high-cpu-constantly https://www.kernel.org/doc/Documentation/usb/power-management.txt

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_block_gpe=0x6F usbcore.autosuspend=-1"
regenerate GRUB

Run sudo update-grub to regenerate /boot/grub/grub.cfg based on the /etc/default/grub settings. This can also be done with sudo grub-mkconfig -o /boot/grub/grub.cfg.

7. Install and configure software packages

These are my frequently used packages and by no means exhaustive. You can use the new Ubuntu Software application or the web and your own discretion to explore the vast ecosystem of available packages.

Install build-tools and essential libraries

sudo apt-get install -y build-essential libssl-dev default-jdk curl vim git vlc 
shutter gimp firefox vifm

Install Git

Setup instructions here.

Install i3wm

Instructions here. Configuration from ~/.i3 (see DotFiles). To solve issues with nautilus desktop window (if present)

gsettings set org.gnome.desktop.background show-desktop-icons false

tmuxinator

sudo apt-get install tmux
sudo gem install tmuxinator

DotFiles

Clone DotFiles repo and move .config files to user directory using the rsync script. I added the rsync script so that I could keep my dot files in a central repository and move them to their desired location.

git clone https://github.com/TStesco/DotFiles.git
. rsync_src_to_dst.sh

Now do a reboot and log in with i3.

Configure gnome terminal

Open default terminal which should be set in dotfiles (UXTerm). Select preferences as desired. I like to have the menu bar be hidden and use custom colours.

Add the bash completion from: https://github.com/tmuxinator/tmuxinator/blob/master/completion/tmuxinator.bash

Install Sublime Text 3

Follow package manager instructions here. Add the package installer.

Install Anaconda

Get the latest installer version for your computer and version of Python here and run it with bash.

Install Docker

The community edition is freely available here for all major OS: https://www.docker.com/community-edition

Install nvm

Node volume manager for node.js and npm. Use install script in the master repo: https://github.com/creationix/nvm

Install Wine

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install -y wine1.7

Additional software packages seldom used: wireshark, nginx, arduino IDE

Tom Stesco

Tom Stesco

I’m a Senior AI/ML Engineer at BCG X, living in Toronto Canada. I went to school at ETH Zürich (MSc) and University of Waterloo (BASc). My interests are in AI/ML for virtuous feedback between machines, people, and their environment.