Wednesday, February 17, 2016

How to Install a 64-bit Ubuntu Linux 14.04.3 LTS on UEFI PC

One thing before we start, and this concerns the firmware (the software used to control low-level tasks) on most modern motherboards.

Basically there are two types of firmware: one is the old-style type BIOS (Basic Input/Output System) and the other is the new EFI or UEFI ((Unified) Extensible Firmware Interface).

While most of us old fogeys are familiar with the BIOS-type firmware, the computer-industry, as a whole, is heading towards the UEFI-type firmware. So it very important for computer enthusiast like me, to fully understand UEFI.

There are a lots and lots of documents and articles on UEFI found on the web – but they seems to have one goal in mind: confuse the hell out of the computer enthusiast – and they all have succeeded beautifully. However, I recommend that any Linux computer enthusiast worth his/her salt, do some research and get to understand UEFI. Anyway, the method outlined in this article is based on a UEFI PC (which is a PC with a new UEFI firmware), which you must possess beforehand.

One more thing before we proceed – I will make the following assumptions regarding both the hardware and software that you are about to use:
  1. You have a relatively modern PC with a UEFI firmware – NOT a PC with a legacy-type firmware (normally called a BIOS). Note that you can use a PC with both UEFI and legacy capabilities. Just make sure that you either configure the PC to use UEFI only or select the correct method when booting the PC from the boot menu if you decide to use the PC with both UEFI and legacy capabilities.

  2. You wish to install a 64-bit version of Ubuntu Linux 14.04.3 LTS (codenamed Trusty Tahr) on it.

  3. The Ubuntu Linux 14.04.3 LTS OS will be the only OS on the PC (NO dual-booting!)

  4. You have a blank HDD or SDD on which you wish to install a 64-bit version of Ubuntu Linux 14.04.3 LTS.

  5. You have a 2GB (or greater) USB stick that you will use to create an install boot drive for Ubuntu.
Now that we have got that part out of the way, let us begin. Follow the steps outlined below.


STEP 1: Create a Bootable Ubuntu 14.04.3 USB Disk



IMPORTANT NOTE: The USB disk used in this part will be written over and all existing data will be destroyed. Backup the data if you do not wish to lose all of it.


You need access to another working Linux PC with Internet connection. Using that PC, open a web browser and go to the Ubuntu web site here . Download the 64-bit iso image to your 'Downloads' folder. Note that the size of this image is 1.3GB so you would require at least a 2GB USB stick to create the USB boot disk.

Plug in the USB disk into a working USB port on the PC and close the file manager if it appears. Launch a terminal and execute:

  dmesg

Make a note of the device name of the just-plugged-in USB disk – for example, one line should read as 'sdc: sdc1' (see below) – which makes the device name in this example as '/dev/sdc'.


Then, we need to create a bootable Ubuntu 14.04.3 USB disk. How you do this, depends very much on the running Linux OS on the PC you are using. For a PC with Ubuntu Linux on it, the 'Startup Disk Creator' utility will be used. For other Linux OS, it is highly recommended that the 'unetbootin' utility be installed on the PC and used to create the USB disk. Select and follow either one of the two sets of instructions below – one for a PC running Ubuntu Linux OS and the other for other Linux OS.

Another Linux PC Running Ubuntu Linux OS

  1. First determine if you have the 'Startup Disk Creator' utility on your Ubuntu PC by opening the dash and search for the item (see figure below) – if found, the dash will show the icon for the item; else, skip the following steps and go to the alternative method.


  2. Click on the 'Startup Disk Creator' icon in the dash search result and the utility will start (see below). If you have downloaded the Ubuntu iso image file and plugged in the USB disk to be used, these will be identified as shown in the figure. You can also choose to erase the USB disk by clicking in the 'Erase Disk' button.


  3. If you have enough free space on your USB disk, you can create a persistent filesystem – use the slider to specify the size of this space. You can also discard all changes on shutdown if so desired.

  4. When you are ready, click on the 'Make Startup Disk' button, enter your password when prompted, and let the process finish (see below). If no errors occurred during the writing process, exit the utility by clicking on the 'Quit' button. You are done creating the bootable USB disk.




  5. Unmount and remove the USB disk from the PC, and close the terminal. The PC will not be required any more so you can shut it down if you wish. Skip the following section and go to the next.

Alternative Method of Creating USB Disk

  1. Using the PC, open a web browser and go to the Unetbootin web site here as shown below. Then download the Linux version by clicking on that button – the download page will appear next (see below). Then download the 64-bit binary file to your 'Downloads' folder. Close the browser after the download has finished.



  2. Open a terminal and execute the commands below:

  3.   sudo apt-get install mtools
      (enter your password)
      cd Downloads
      chmod +x ./unetbootin-linux64-613.bin
      ./unetbootin-linux64-613.bin

  4. Enter your password if prompted and the Unetbootin screen will appear (see below).


  5. Select 'Diskimage' then click on the '...' button and locate the Ubuntu iso image file that was downloaded and click on the 'Open' button (see below).


  6. Make sure that the USB disk has been correctly identified by Unetbootin. If you have enough free space on your USB drive, you can create a persistent filesystem – enter the desired space in the box. Then click on the 'OK' button to start the creation process. Wait until it is done (see below), then close Unetbootin.



  7. Then unmount the USB disk, then exit the terminal by executing:

  8.   sudo umount /dev/sdc1
      (enter your password)
      exit

  9. Remove the USB disk from the PC (it is not mounted so it is safe just to remove it physically), and close the terminal. The PC will not be required any more so you can shut it down if you wish.


NOTE: The creation of the USB boot disk was done on a Linux PC in the above example. You can, however, use a Windows PC to create the USB boot drive. It is highly recommended that you use the 'Unetbootin' utility on Windows PC to copy the iso images downloaded from the Ubuntu web site, to the USB disk. Please do not use any other utilities for creating the USB boot disk.



STEP 2: Booting The PC On Which Ubuntu Is To Be Installed


On the PC that the Ubuntu Linux OS will be installed, plug in the USB boot disk and power it on. Press the Boot Menu function key (e.g, F12 for Gigabyte, or F8 for Asus motherboards used by the PC) after the POST beep. At the Boot Menu, select the USB drive with 'UEFI' as part of it's name, and press the 'Enter' key.


NOTE: If you have set the PC's firmware (or BIOS) for both UEFI and legacy boot, and if you did not press the Boot Menu function key to enter the Boot Menu and the main HDD or SDD is blank, the PC will boot up using UEFI from the USB disk.


Wait until the PC has finished booting – the GRUB menu should appear. Select 'Try Ubuntu without installing' or 'Install Ubuntu' (if it is not already selected) followed by the 'Enter' key. The screenshots that you see from now on was produced by the 'Try Ubuntu without installing' method – which was the only one that allows capturing of screens during the installation. It is because of this that the 'Try Ubuntu without installing' method is highly recommended by the author.

If you see the Ubuntu desktop, then skip the following paragraphs for the special Note, and go directly to Step 3. If you do not see the Ubuntu desktop, and ended up with a black (or blank) screen, then you need to press the PC's reset key and follow the instructions below.


NOTE – Special Instructions to Solve Black Screen Problem

The steps outlined below are for those who get a black (or blank) screen when booting up. For those curious as to why you get the 'black screen of death' (as it is affectionately known amongst computer enthusiast) the reason can be summoned up in one word – driver. The video card you are using do not have any Linux driver – probably because it so brand new on the market or because it is so old that it is no longer supported by Linux. There could be other reasons, but the main thing is how to boot up the PC so that you can install Ubuntu Linux. Just follow the steps outlined below.

Power up you PC and press the Boot Menu function key after the POST beep. Select the USB drive with 'UEFI' as part of the name, and press the 'Enter' key. Wait until the PC has finished booting – the GRUB menu should appear.

Select 'Try Ubuntu without installing' (this one is recommended) or 'Install Ubuntu' if it is not already selected.

Press the 'e' key in order to edit the boot parameters which you will see displayed on the screen. Place the cursor on the line that starts with 'linux', then move the cursor after the 'casper', followed by a space.

Type the following characters (without the quotes) 'nomodeset'. Then press the 'F10' key and the PC will start booting.

In case you are curious about the 'nomodeset' boot parameter, adding the 'nomodeset' parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded. In effect, this will allow the usage of BIOS video mode BEFORE the correct video drivers are installed. Otherwise you will only see a blank (black) screen during installation of a Ubuntu Linux system.




STEP 3: Installing Ubuntu Linux


When booting is completed, and if you have selected the 'Try Ubuntu without installing' item, you will see the desktop with the 'Install Ubuntu 14.04.3 LTS' icon on it (see below). Double-click on it to start the installer. Then follow the steps below.


  1. You will see the first item for the installer – which is the language selection (see below). Make your selection and press the 'Enter' key (or click on the 'Continue' button on a graphical install).


  2. On the next screen (see below), both the 'Download updates while installing' and 'Install this third-party software' were selected, the 'Continue' button was clicked.


  3. The next screen shows the 'Installation type' where you choose how you want to install Ubuntu. Since you have a blank HDD or SDD, the default action is to erase the disk and install Ubuntu, and this has been selected for you. Just click on the 'Continue' button.


  4. Next you have to specify on which disk you want Ubuntu to be installed – the default is /dev/sda (see below) – click on the 'Install Now' button if this is acceptable.


  5. You will see a confirmation screen like the one shown below. Note the partition layout which is a bit different from the layout on a non-UEFI PC as it includes the EFI partition as shown. Click on the 'Continue' button to proceed.


  6. Specify which country you are located, either by typing the name or clicking on the map (see below). Then click on the 'Continue' button.


  7. Select the keyboard layout that you use (see below) and click on the 'Continue' button.


  8. Enter your details in the fields shown in the screen shown below. Use the 'Tab' key to move between fields. Then click on the 'Continue' button.


  9. The Ubuntu installation will begin (see below).


  10. Wait until it finishes and you will be prompted to restart the system (see below). Do so or continue testing the system and restart when you have finished testing.





STEP 4: Booting Into The New Ubuntu System


Remove the boot USB disk while the PC restarts, and you will see the GRUB menu. Wait for a while (or press the 'Enter' key) and the PC will continue booting and the log in screen will appear.


NOTE: If your PC hangs after starting from the GRUB menu, press the PC's reset key and let it boot up to the GRUB menu. Then press the 'e' key to edit the the boot parameters which you will see displayed on the screen. Place the cursor on the line that starts with 'linux', then move the cursor after the 'ro' and a space. Type the following characters (without the quotes) 'nomodeset'. Then press the 'F10' key and the PC will continue booting to the log in screen.


Log in using your name, and you will be at the Ubuntu desktop. If you wait for a while, and assuming you are connected to the Internet and there are updates for Ubuntu 14.04.3, you will see an additional icon pop up in the launcher (see below as pointed by the green arrow). This icon (which resembles the letter 'A') serves to notify you that there are updates available. Note that, if there are no updates available, the icon in the launcher will not appear.


Click on the icon and the screen as shown below will appear. Click on the 'Install Now' button to start the downloading and installing of the updates. You will be prompted to enter you password – do so, and the process will resume. Wait until the updating process has finished.


Depending on the updates installed, a re-start may be required as shown in the screen below. Do so to make to complete the updates.


After updating your new Ubuntu Linux, the next task to carry out is to first identify what video card your PC is using and what drivers are bring used currently. To do this, open a terminal and execute:

  lspci -nn | grep VGA

If you are using an AMD/ATI video card, then the resulting screen output may look like this:


If you are using a Nvidia-graphics based PC with dual video output (e.g, a PC fitted with a Gigabyte Z97 Intel chipset-based PC motherboard), then the resulting screen output may look like this:


Next you need to determine the drivers being used currently being used by opening a terminal and executing:

  lspci -nnk | grep -i vga -A3 | grep 'in use'

The output screen may look like these:



You may also be interested to find out the current resolution of your display – open a terminal and execute:

  xrandr

The item which indicates the current resolution is marked with an asterisk – in my case, it is 1920x1080 (see below as indicated by the green arrow).


Now you have to make a decision – if you are satisfied with the current video driver and your display is at the maximum resolution, then you may decide to keep things as they are. On the other hand, if you play games (e.g, Steam games) that require an hardware-accelerated video card; then by all means, install the video driver that enable you to do this. Note that, these video drivers are mainly proprietary drivers – no open source code are available.

Sometimes, you need not make the decision yourself – Ubuntu will do so by popping up a notification on-screen (see below) about restricted drivers (mostly video drivers) being available.



NEW EDIT: Before installing the new hardware-accelerated video drivers, you do need to install the 32-bit architecture to the repositories by opening a terminal and executing:

  sudo dpkg --add-architecture i368
  ssudo apt-get update

The last command is for updating the repositories after adding the i386 architecture.


To install these drivers, either click on the icon in the notification panel at the top right hand of display (see below) or search for 'drivers' using the dash (see below), then click on the 'Additional Drivers' icon.



You may see a screen window pop up as shown below (you may have to wait for while for the available drivers to be fetched from the Internet):


Note that this is only an example – your screen may look different. However, you have to select a suitable driver from the list displayed (consult the Web if you are unsure about which driver to pick) and then click on the 'Apply Changes' button. Wait for the process to finish, then close the window.


NEW EDIT: Before restarting and if you have installed the new hardware-accelerated video driver, you need to create an Xorg configuration file by opening a terminal and executing:

  sudo mkdir /etc/X11/xorg.conf.d

If you have an Nvidia video card and has installed the hardware-accelerated video driver, execute the following:

  sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf

In the new configuration file, insert the following lines:

  Section "Device"
          Identifier "My GPU"
          Driver "nvidia"
  EndSection

Save the file and exit nano. Then skip the following section on AMD/ATI card and proceed to restart the PC.

If you have an AMD/ATI video card and has installed the hardware-accelerated video driver, execute the following:

  sudo nano /etc/X11/xorg.conf.d/20-fglrx.conf

In the new configuration file, insert the following lines:

  Section "Device"
          Identifier "My GPU"
          Driver "fglrx"
  EndSection

Save the file and exit nano.


Perform a restart to load the new video driver.

That's it – you now have an Ubuntu 14.04.3 Linux UEFI PC. Enjoy!

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete