Installing Linux

= Which Linux =

I personally recommend Kubuntu or Xubuntu, which are Ubuntu derivatives. They are not perfect, but I found the other Linux distributions I tried even more annoying.

Kubuntu vs Xubuntu
Kubuntu uses the KDE desktop environment. After so many years, we need to face the truth: KDE will never turn into a polished, reliable desktop environment. Something has been wrong for a very long time in the KDE development team. Expect constant annoyance.

Xubuntu uses the XFCE desktop environment, which is faster and more reliable. The trouble is, it is not as flexible, and it also lacks basic features, like turning off the laptop touchpad when plugging a USB mouse. Another example: the standard file manager Thunar does not have a split view, unlike everybody else. To top it all, XFCE/Xubuntu ships with annoying defaults, and reconfiguring it is not intuitive.

The good news is that, after installing Kubuntu or Xubuntu, you can easily switch to the other one, as they share the same Ubuntu base. This way, you can comfortably decide which one is the least uncomfortable for you.

General Kubuntu/Xubuntu advice

 * If you have Ubuntu 12.04 LTS or some derivative, I would upgrade to 14.04 LTS now.
 * For new installations, go for Kubuntu/Xubuntu 14.04 LTS.
 * Kubuntu/Xubuntu 16.04 is not quite ready yet, even in the 16.04.1 version, so I would wait on this one.
 * Every now and the, upgrade the kernel and X-Windows versions. Instead of Service Pack, this kind of upgrade is called LTS Hardware Enablement Stack in the Ubuntu world. Wait at least 3 months after a Hardware Enablement Stack has been released before upgrading.
 * Skip all the non-LTS versions like 13.10.
 * Wait at least 6 months to upgrade to the next LTS version. In my experience, Kubuntu/Xubuntu has to ship on a particular date, and they do not really care much if there are still annoying bugs at that date, or whether they remain for months afterwards.

= Things to Do after Installing Kubuntu 14.04 =


 * System configuration:
 * Are the BIOS and Linux date/time and timezones correct?
 * Is the BIOS set to boot only from the Linux disk?
 * Make the Grub bootloader accessible. Otherwise, if you PC ever fails to start and you need access to the bootloader, it will probably be too late. You have 3 options:
 * Option 1) Install package grub-customizer, and then start the Grub Customizer tool. Enable the "show menu" option, and set the "Boot default entry after" to 1, so that you have 1 second to press the arrow down key (for example) and stop the boot process.
 * Option 2) For Kubuntu, install package kde-config-grub2, and you can configure it with the mouse under System Settings, Startup and Shutdown, GRUB2 Bootloader. Choose "Automatically boot..." after 1 second, so that you have 1 second to press the arrow down key (for example) and stop the boot process. As a bonus, you can comfortably remove old kernels on this window too.
 * Option 3) Manually edit /etc/default/grub, add GRUB_TIMEOUT=1, comment out GRUB_HIDDEN_TIMEOUT, run sudo update-grub2. You may also want to remove kernel options quiet and splash in order to see the boot messages.
 * Check the available proprietary drivers. I am not sure about installing proprietary (non-open-source) drivers for AMD or nVidia graphics cards, but using the latest processor microcode is probably a good idea.
 * Enable Ctrl+Alt+Backspace to kill the current graphical session. If you make a mistake and/or your system becomes unresponsive, this key combination may be the safest and quickest way out. Edit "/etc/default/keyboard", find variable XKBOPTIONS and set it to "terminate:ctrl_alt_bksp".
 * Reduce the amount of reserved disk space. On ext4 filesystems, Linux reserves some disk space for privileged processes and to help prevent fragmentation. The default amount of 5 % comes from the times where hard disks were much smaller. You can reduce it to 1 % with command "sudo tune2fs -m 1.0 /dev/sdXY". In order to find out how much is reserved: sudo tune2fs -l /dev/sdXY | grep -e "Reserved block count:" -e "Block count:"
 * Install some useful packages:
 * Synaptic seems to be the only reasonable package manager for Ubuntu.
 * Install package "trash-cli" and get used to deleting files with "trash" instead of "rm". If you make a mistake and delete the wrong file, you'll be able to recover it from the desktop trashcan/wastebin.
 * Install package "exfat-fuse", in case some external disk has been formatted by Windows with the exFAT filesystem.
 * You may want to install legally-encumbered codecs and DVD playback: sudo apt-get install ubuntu-restricted-extras libavcodec-extra sudo apt-get install libdvdread4 sudo /usr/share/doc/libdvdread4/install-css.sh
 * Performance optimisation:
 * Optimise filesystem performance with noatime. Edit /etc/fstab and add options "noatime,commit=30" to your filesystems.
 * Disable unnecessary indexers:
 * updatedb / locate database. See mlocate conflicting package.
 * (Kubuntu only) KDE Baloo (formerly Nepomuk). Go to System Settings, Desktop Search, and add your home folder, which acts as an indication to turn the indexer off. Later note: they have finally added an "Enable Desktop Search" checkbox with the latest update.
 * (Kubuntu only) KDE Akonadi. Go to System Settings, Personal Information, stop the service.
 * Prevent unexpected system updates. Unexpected package manager activity in the background can render your PC slow or even unresponsive when you are in a hurry. Configure the system updates to check less often (weekly or every fortnight) and disable automatic installation.
 * KDE preferences:
 * Choose "Start with an empty session" in "System Settings", "Startup and Shutdown", "Session Management". You will probably want to untick option "Confirm logout" too.
 * Configure Keyboard shortcuts like under Windows: Go to "System Settings", "Shortcuts and Gestures", and then:
 * Ctrl+Esc should bring up the start menu: "Global Keyboard Shortcuts", "Plasma Desktop Shell", "Activate Application Launcher Widget".
 * Ctrl+Shift+Esc should bring up the Task Manager: "Custom Shortcuts", "Edit", "New Group", then, in that group, "New", "Global Shortcut", "Command/URL", "Trigger", set Ctrl+Shift+Esc, "Action", enter "ksysguard". Make sure the new group is active by ticking the box next to its name.
 * Alt+Space should bring up the window menu: "Global Keyboard Shortcuts", "Kwin", "Window Operations Menu" ("Fensteraktionen-Menü in German).
 * Remove some keyboard shortcuts that tend to conflict with other apps, like the following (is there a way to find a KDE shortcut by key combination in all "KDE components"?):
 * Global Keyboard Shortcuts, KWin: Ctrl+F1 ... Ctrl+F7.
 * If the window resize borders are too thin and therefore hard to hit: Go to "System Settings", "Workspace Appearance", "Window Decorations", "Configure Decoration...", "General", "Border size".
 * Add pavucontrol ("PulseAudio Volume Control") to your favourites. You may need to install package pavucontrol first. The standard volume control applet does not let you choose where an application like Skype should be recording the audio from.
 * Install plug-ins for the Dolphin file manager. Install package ruby. Then open the file manager, go to Control, Configure Dolphin..., Services, Download New Services.... Add "Root Actions Servicemenu" and "Scan with ClamAV".
 * The User Manager tool in System Settings is useless. Install package kuser, and run "sudo kuser" instead (or KUser from the menu).
 * Minimised windows get very pale taskbar icons and captions, making it hard to tell which window they represent. To fix that for the icons: Go to System Settings, Application Appearance, Icons, Advanced, Desktop, click on Set Effect for the Disabled icon, select "No Effect" and untick the "Semi-transparent" option. Unfortunately, I don't know how to fix that for the caption texts yet.
 * If connecting a USB stick does not automatically mount it, or it asks too much confirmation, look at System Settings, Removable Devices.
 * emacs warns: "Buffer 'somefile.txt" still has clients; kill it?". Go to System Settings, File Associations, text, plain, emacsclient, Edit..., Application, "Command:", enter "emacsclient --no-wait".
 * Configure some of the usual system tools to run as root without password. Although this system configuration change is probably not watertight, this time I prefer productivity over security. This is what I usually add to my /etc/sudoers file:

# ALWAYS edit file "/etc/sudoers" with "sudo visudo", because visudo edits the sudoers file in a safe fashion. # Otherwise, the smallest syntax error can lock you out of the system. # # I could not get this to work with KDE's default application menus. This is what I did to make it work # for each application: # Right-click on the bottom-left 'K' icon, choose "Edit Applications...", copy and paste the entry for each # application (like Synaptic), edit the copy, use "kdesudo synaptic" as the command, untick "run as a different user". # Untick also "Enable launch feedback", as it probably gets confused because of the root user it is running the application as. # Then use this new icon to start synaptic as root without password. # # Instead of "myuser" below, you can choose "%sudo" for all users that belong to the 'sudo' group. # The 'ALL' in 'ALL=(root)' is the hostname. # The "" below at the end of some commands limits the effect of that permissions line to running the application with no arguments. # Note that you cannot give NOPASSWD permissions to any file, like some script under your home directory, # because sudo seems to carefully check permissions along the way. Files under /usr/sbin/ (for example) are fine. # The order of the entries is important, the last one wins. # # The alternative would be using a script with setuid set, but setuid is disabled by default in Debian # for shell scripts. You can use some setuid wrapper as a workaround, but these changes # to /etc/sudoers are probably safer. myuser ALL=(root) NOPASSWD: /usr/sbin/synaptic "" myuser ALL=(root) NOPASSWD: /usr/bin/muon-updater "" myuser ALL=(root) NOPASSWD: /usr/bin/apt-get install * myuser ALL=(root) NOPASSWD: /usr/bin/apt-get update "" myuser ALL=(root) NOPASSWD: /usr/bin/apt-get upgrade ""

For PCs with only 512 MiB RAM
512 MiB of RAM is too little nowadays for Ubuntu-based system. Starting the package manager is already a heavy load for such a computer. Here is some suggestions:


 * Get rid of apt-xapian-index, see Fake Replacement for Debian Package apt-xapian-index
 * Switch to a lightweight Web browser like Midori. You will lose some comfort, and some pages will not display properly, but Firefox and Chromium are just too heavy.
 * Optimise your swap:
 * Move your swap partition to another drive.
 * If you have more than one drive, move the swap partition or file to the least-busy disk.
 * Try swapping to a USB stick. Here is a how-to guide.
 * If the computer has a memory card reader, you could use a fast memory card as the main swap drive. I have seen great swap performance improvements even with a standard 512 MB SD card (8.5 MB/s read speed, 2.5 MB/s write speed, 1 ms seek time) from an old digital camera connected over a cheap USB 2.0 card reader. The reason behind the improvements are probably the card's fast seek time and the lower pressure on the main hard disk.
 * If your video card has a lot of memory, some people have managed to use some of it as a swap device.
 * Reduce the swappiness from the default 60 to 10. Whether this will improve swapping is debatable. It is probably a good idea only if you cannot move your swap partition to another drive. Add "vm.swappiness = 10" to file "/etc/sysctl.conf".
 * Try swapping to zram. It made things worse for me, but your mileage may vary.
 * Switch to a lightweight Linux distribution. Xubuntu or Lubuntu will not bring much. You could try Puppy Linux.

= KDE Ramblings =

KDE Tips

 * Useful keyboard shortcuts are:
 * Ctrl+Alt+Esc: Kill window on click, similar to starting xkill.
 * Ctrl+Alt+L: Lock desktop.
 * Emptying the Trash takes forever, and manually deleting the ".Trash-1000" directory with the mouse tends to yield an error. To overcome it, hold the shift key while pressing the delete key on that directory. Alternatively, right-click on the folder to get the pop-up menu, and then hold the shift key and watch how the "Move to Wastebin" entry mutates to "Delete". Release the shift key and it will go back to normal. That only works if there is no submenu open at that time.

KDE Rants
KDE Rant about ".directory" files:
 * KDE tends to litter your hard disk with hidden ".directory" files, and there is no way to prevent it. It just remember the view settings for the last N directories, like Windows does, and it should cache those settings somewhere under $HOME instead of creating those pesky files all over the place.
 * The Dolphin file manager does not display MP3 ID tags like everybody else. Older versions used to (!).
 * The "safely remove" eject icon for USB drives is often missing from the "device notifier" pop-up window. Sometimes it is because the file system has not been mounted automatically. But sometimes, there is no real reason. If you then open a Dolphin window and right-click on the USB drive mount on the left panel, the eject option is shown there.