Installing a new Ubuntu version from scratch without any effort

Scenario: You have an existing Ubuntu installation and you want to install a newer version (e. g. Ubuntu 18.04) from scratch, i. e. drop the old installation completely and install the new version in place.

The trick/precondition which makes the installation effortless: On the current system, you already have your “/home” directory and your “/” (root) directory on different partitions. Then you can drop the old Ubuntu installation on the root partition and install the new Ubuntu version on this partition and the home partition can simply be adopted. If you don’t have your root directory and your home directory on different partitions, make a backup of your home folder and restore it later.

Prerequisites

  1. Important: Backup important data first!
  2. Download the latest Ubuntu release here: https://www.ubuntu.com/download/desktop

Let’s go: Create a bootable pen drive

Write the downloaded Ubuntu ISO file to a pen drive using dd (existing data on the pen drive will be lost after this process). First: Make sure that the pen drive is NOT mounted. Then: Open a terminal and login as root and call dd:

$ sudo su

# dd bs=50M if=/home/YOUR_NAME/Downloads/ubuntu-18.04.1-desktop-amd64.iso of=/dev/sdX && sync

Please change the path after “if=” to the path where the downloaded ISO file actually lies and change the path after “of=” to the device which represents your pen drive. You can use “lsblk” or “df -h” on the terminal to view your devices and spot your pen drive. It is really important to identify the correct device name as dd will overwrite existing partitions which can result in data loss if you aren’t cautious!

The installation

Now you have to boot from the newly created Ubuntu pen drive. Reboot your machine and select the pen drive as boot drive and boot from the pen drive. This step is a bit tricky (but not too hard) and differs from hardware to hardware. On Acer notebooks, you can try hitting F12 or F2 as described in this article.

When the pen drive is booted, you can follow the installation wizard most of the time. When it comes to partitioning: If you already have a separate “/” (root) and “/home” partition: Configure the old root partition as new root partition and check the format checkbox. Configure the old home partition as new home partition (do NOT check the format checkbox this time).

If you are asked whether to install proprietary software: choose NO. The proprietary things can mess up the whole system (at least this is what I experienced in the past).

When the installation is done: Confirm to reboot the machine and remove the pen drive when instructed.

Post-installation actions

Update the system

$ sudo su
# apt-get update
# apt-get upgrade

Install the multimedia codecs

$ sudo su
# apt-get install ubuntu-restricted-extras

Install support for encrypted DVDs

So as to play encrypted DVDs you have to install the package libdvdcss2 which is not in the official repositories. That’s why you have to add a new repository to your “/etc/apt/sources.list”. Just add the following line:

deb https://download.videolan.org/pub/debian/stable/ /

Then run:

$ wget -O - https://download.videolan.org/pub/debian/videolan-apt.asc | sudo apt-key add -

…and finally install the package:

# apt-get update
# apt-get install libdvdcss2

If you still cannot watch DVDs, try to disable the DVD menu in VLC media player: “Media | Open Media (Ctrl+D)” and check “No disc menu” and click on “Playback”.

Hints: http://www.videolan.org/developers/libdvdcss.html

Remove Amazon app

Open Ubuntu Software Center, go to tab “Installed” and click on remove next to the Amazon app.

Enabling the touchpad of your notebook

If your touchpad does not work out of the box then go to “System settings | Devices” and enable your touchpad.

Install your favourite software

apt-get install clementine keepass vlc zim...

Installing Fairphone Open on Fairphone 2 and app advices

In this article I’m going to explain how to install Fairphone Open (the Android version without the Google Mobile Services) on my Fairphone 2 using my Linux system (Mageia 6). The official Installation Guide can be found here.

  1. Install the package android-tools:
    urpmi android-tools
  2. The package above installs the command-line tool fastboot-android. But the flashing script (see below) expects the command-line tool fastboot. Because of this we need to create a link fastboot which points to fastboot-android:
    ln -s /usr/bin/fastboot-android /usr/bin/fastboot
  3. Download the switcher package and unzip it (see Official Installation Guide).
  4. Boot your phone into the fastboot mode (hold the volume down button while you power on your phone). Your phone is in fastboot mode when you see a static screen with a simple Fairphone lettering, black background and the lettering “Fairphone powered by android”.
  5. Connect your phone with your computer via USB cable.
  6. Execute the flash script which is contained in the switcher package:
    sh flash-for-unix.sh
    If you see something like:

     

    WARNING: No Fairphone 2 found in fastboot mode.
    WARNING: Make sure that a Fairphone 2 is connected.
    WARNING: To check for devices, type ‘/usr/bin/fastboot devices’.

    …then try to execute the command as root.

  7. When done you will see something like:

    Flashing successful!
    Your Fairphone 2 will now run Fairphone Open 18.02.0.

    Press Enter to reboot the device and complete the installation…

    Just hit ‘Enter’ and your device will reboot.

  8. The reboot takes a while, so be patient =)

After all, you end up in a fresh Android system without the proprietary Google Mobile Services. As the Play app store is also part of the Google Mobile Services, you might want to install an alternative app store like F-Droid. F-Droid is really awesome because it only contains open source software.

Some apps can even be installed without app store (e. g. WhatsApp, Threema) so if you rely on these apps you can just download the APK files using your browser and install them manually. Two apps I highly recommend:

  • Firefox Focus (german version: Firefox Klar): Firefox browser for android with pre-installed ad-blocker and tracking protection. It clears your browsing history automatically when you close it (really ace!).
  • Öffi: Provides information about means of public transportation (e. g. trains and busses). Works well in Germany (and other european countries) and can replace the DB Navigator app completely.