Getting started with Ubuntu: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Lvosandi (talk | contribs)
Lvosandi (talk | contribs)
No edit summary
Line 59: Line 59:
For checking smartcard support for Estonian ID-card you have to install some extra packages:
For checking smartcard support for Estonian ID-card you have to install some extra packages:


   apt-get update
   sudo apt-get update
   apt-get install opensc pcscd
   sudo apt-get install opensc pcscd
   opensc-tool -l
   opensc-tool -l


If you identify Broadcom 43xxx wireless chip in your laptop you have to install extra package to have a snowballs chance in hell, note that you need wired network for this:
If you identify Broadcom 43xxx wireless chip in your laptop you have to install extra package to have a snowballs chance in hell, note that you need wired network for this:


   apt-get update
   sudo apt-get update
   apt-get install bcmwl-kernel-source
   sudo apt-get install bcmwl-kernel-source
   modprobe wl
   sudo modprobe wl


Also check that:
Also check that:
Line 83: Line 83:
The easiest way to check whether LiveCD is booted in EFI mode is using <code>efibootmgr</code>:
The easiest way to check whether LiveCD is booted in EFI mode is using <code>efibootmgr</code>:


   modprobe efivars
   sudo modprobe efivars
   apt-get update
   sudo apt-get update
   apt-get install efibootmgr
   sudo apt-get install efibootmgr
   efibootmgr
   sudo efibootmgr


If you see a list of boot targets then the LiveCD has access to EFI boot entries. If you see <code>efibootmgr: EFI variables are not supported on this system.</code> this means the LiveCD has been booted in Legacy mode.
If you see a list of boot targets then the LiveCD has access to EFI boot entries. If you see <code>efibootmgr: EFI variables are not supported on this system.</code> this means the LiveCD has been booted in Legacy mode.
Line 92: Line 92:
To check whether Windows is installed in EFI mode you should see whether GPT partition table is used and EFI boot partition exists:
To check whether Windows is installed in EFI mode you should see whether GPT partition table is used and EFI boot partition exists:


   apt-get update
   sudo apt-get update
   apt-get install gdisk
   sudo apt-get install gdisk
   gdisk -l
   echo p | sudo gdisk /dev/sda


If no GPT partition table is present it's surely a Legacy boot installation.
If no GPT partition table is present it's surely a Legacy boot installation.
Line 138: Line 138:
   sda3: Linux swap, 4GB
   sda3: Linux swap, 4GB
   sda4: Linux home filesystem, ext4, mounted at /home
   sda4: Linux home filesystem, ext4, mounted at /home


==Beyond installation==
==Beyond installation==

Revision as of 17:25, 3 September 2015

Ubuntu is an Linux distribution based on Debian package management system. Ubuntu is widely used on servers and in the cloud. Ubuntu is composed of thousands of software packages distributed under mostly free and open-source licenses.

Downloading Long-Term Support version

The Long-Term Support versions tagged as LTS are recommended for production environments where stability is a must. For 64-bit machines with 4GB+ of memory pick the amd64 releas, otherwise stick to i386.

For high-end PC-s and laptops the original Ubuntu is recommended:

wget ftp://ftp.estpak.ee/pub/ubuntu-releases/14.04/ubuntu-14.04.3-desktop-amd64.iso
wget ftp://ftp.estpak.ee/pub/ubuntu-releases/14.04/ubuntu-14.04.3-desktop-i386.iso

For low-end PC-s and laptops Ubuntu MATE is recommended:

wget https://ubuntu-mate.r.worldssl.net/trusty/ubuntu-mate-14.04.2-LTS-desktop-amd64.iso
wget https://ubuntu-mate.r.worldssl.net/trusty/ubuntu-mate-14.04.2-LTS-desktop-i386.iso

MATE carries on the GNOME classic desktop spirit which many users are used to.


Downloading bleeding edge version

Due to rapidly evolving hardware you might stumble on for example WiFi chip or some other component which doesn't work as expected with Long-Term Support release, in that case you might want to check out later releases. Be ware that non-LTS releases also incorporate software changes that might break your workflow!

wget ftp://ftp.estpak.ee/pub/ubuntu-cdimage/ubuntu-mate/releases/vivid/release/ubuntu-mate-15.04-desktop-amd64.iso
wget ftp://ftp.estpak.ee/pub/ubuntu-cdimage/ubuntu-mate/releases/vivid/release/ubuntu-mate-15.04-desktop-i386.iso

Writing the LiveCD image to memory stick

All of the ISO images listed above contain hybrid bootloader, which means that same image can be written to CD-R or USB memory stick both.

For Linux there is no need to fetch extra tools to write the image to a USB memory stick, simply use dd:

 sudo dd if=ubuntu-14.04.3-desktop-amd64.iso of=/dev/sdx # Substitute sdx with your memory stick

Or if you're already root, you can simply use cat:

 cat ubuntu-14.04.3-desktop-amd64.iso > /dev/sdx # Again substitute sdx with your memory stick

If you're running on Windows, you can use Win32 Disk Imager to write the ISO image to the USB memory stick.

After this you're left with a memory stick with pretty funky partition table (eg 59MB storage), but don't worry -- we can fix that! Once you've successfully booted to Ubuntu you can write zeroes to the USB memory stick like this:

dd if=/dev/zero of=/dev/sdx # Substitute sdx with your memory stick block device

Booting LiveCD

Reboot your machine and identify the keystroke for temporarily booting from external storage such as USB memory stick. If the machine fails to boot check that Secure Boot is disabled in BIOS.

Once the Ubuntu desktop appears check that all necessary hardware is properly detected:

 iwconfig
 lspci -t -v -nn
 lsusb -t
 dmidecode

For checking smartcard support for Estonian ID-card you have to install some extra packages:

 sudo apt-get update
 sudo apt-get install opensc pcscd
 opensc-tool -l

If you identify Broadcom 43xxx wireless chip in your laptop you have to install extra package to have a snowballs chance in hell, note that you need wired network for this:

 sudo apt-get update
 sudo apt-get install bcmwl-kernel-source
 sudo modprobe wl

Also check that:

  • Suspend and resume work as expected.
  • Audio playback/recording works.
  • Wired/wireless network connectivity works.
  • Your Bluetooth devices work.


Checking EFI support

If you want to keep your Windows installation alongside with your new Linux installation you should identify whether EFI or legacy boot mode is used by Windows. Linux should use the same method. Note that Windows 8 mandates the use of EFI, for Windows 7 it's optional. Latest x86 based Mac-s also use EFI. In some BIOS-es you can also check whether EFI, Legacy or mixed mode is used for booting. Some motherboards boot LiveCD using legacy method even though the Windows might have been installed using EFI method, in that case you'll end up with non-bootable machine because LiveCD is unable to manipulate EFI boot entries.

The easiest way to check whether LiveCD is booted in EFI mode is using efibootmgr:

 sudo modprobe efivars
 sudo apt-get update
 sudo apt-get install efibootmgr
 sudo efibootmgr

If you see a list of boot targets then the LiveCD has access to EFI boot entries. If you see efibootmgr: EFI variables are not supported on this system. this means the LiveCD has been booted in Legacy mode.

To check whether Windows is installed in EFI mode you should see whether GPT partition table is used and EFI boot partition exists:

 sudo apt-get update
 sudo apt-get install gdisk
 echo p | sudo gdisk /dev/sda

If no GPT partition table is present it's surely a Legacy boot installation.


Installing on permanent storage

While you can do a lot of stuff directly off the memory stick, it's not suitable for daily use. If you're confident you want Linux installation of your machine and you've backed up all important data proceed with this chapter, otherwise check below how to run Linux safely in a virtual machine.

Before continuing make sure you have backed up all important data! Partition resizing is not as dangerous as it was back in 2009, but accidents happen. You've been warned!

Double click on the Install Ubuntu 14.04 on the LiveCD desktop and follow instructions on the screen up to the harddisk partitioning. To make upgrades as easy as possible make sure you use separate mountpoints for / and /home.

Hence for Legacy dual-boot installations the partition table would look like this:

 sda1: Windows 7, NTFS, mounted at /mnt/windows
 sda2: Windows recovery, NTFS, not mounted
 sda4: Extended partition
 sda5: Linux root filesystem, 20GB, ext4, mounted at /
 sda6: Linux swap, 4GB
 sda7: Linux home filesystem, ext4, mounted at /home

And for EFI dual-boot installations:

 sda1: EFI boot partition (ef00), mounted at /boot/efi
 sda2: Windows 8, NTFS, mounted at /mnt/windows
 sda3: Windows recovery, NTFS, not mounted
 sda4: Linux root filesystem, 20GB, ext4, mounted at /
 sda5: Linux swap, 4GB
 sda6: Linux home filesystem, ext4, mounted at /home

For Linux-only legacy installations:

 sda1: Linux root filesystem, 20GB, ext4, mounted at /
 sda2: Linux swap, 4GB
 sda3: Linux home filesystem, ext4, mounted at /home

For Linux-only EFI installations, you may take advantage of the BIOS boot partition to avoid adding EFI entries which may get lost with BIOS reset:

 sda1: BIOS Boot Partition (ef02), 1MB
 sda2: Linux root filesystem, 20GB, ext4, mounted at /
 sda3: Linux swap, 4GB
 sda4: Linux home filesystem, ext4, mounted at /home


Beyond installation

Enable additional software repositories in /etc/apt/sources.list:

deb      http://ee.archive.ubuntu.com/ubuntu/ trusty            main restricted universe multiverse
deb-src  http://ee.archive.ubuntu.com/ubuntu/ trusty            main restricted universe multiverse
deb      http://ee.archive.ubuntu.com/ubuntu/ trusty-updates    main restricted universe multiverse
deb-src  http://ee.archive.ubuntu.com/ubuntu/ trusty-updates    main restricted universe multiverse
deb      http://ee.archive.ubuntu.com/ubuntu/ trusty-backports  main restricted universe multiverse
deb-src  http://ee.archive.ubuntu.com/ubuntu/ trusty-backports  main restricted universe multiverse
deb      http://security.ubuntu.com/ubuntu/   trusty-security   main restricted universe multiverse
deb      http://archive.canonical.com/ubuntu/ trusty            partner

Install Estonian ID-card software stack:

apt-get install apt-transport-https
apt-key adv --keyserver keyserver.ubuntu.com --recv 43650273CE9516880D7EB581B339B36D592073D4
echo "deb https://installer.id.ee/media/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/ria-repository.list
apt-get update
apt-get install estonianidcard opensc pcscd libnss3-tools

Generate Digidoc plugin for MATE's file browser if you installed Ubuntu MATE:

sed -e 's/Nautilus/Caja/g' /usr/share/nautilus-python/extensions/nautilus-qdigidoc.py > /usr/share/caja-python/extensions/caja-qdigidoc.py


Installing in VirtualBox

Download VirtualBox and install it on your PC. Create a virtual machine for Ubuntu, make sure you allocate at least 1GB of memory and attach 10GB virtual disk image. Download Ubuntu MATE ISO file referenced above and use the newly created virtual machine to boot the ISO. Note that installing original Ubuntu in a virtual machine is troublesome due to laggy 3D virtualization. Use the Linux-only partitioning scheme described above.

Once you have installed Ubuntu in a virtual machine make sure you have X11 drivers for virtualized hardware, this should enable better mouse/keyboard integration and ability to copy-paste between guest and host:

apt-get install virtualbox-guest-x11