How to upgrade to new version of Ubuntu

When a new version of Ubuntu rolls out, you might want to upgrade your older Ubuntu to that version. There are many ways to do this.

Upgrade

If your current Ubuntu is not too old, then Ubuntu might support an upgrade to the latest version. There are two types of upgrade possible: to any latest version or to only the latest long-term support (LTS) version.

  • To do this, open Software Updater or run update-manager at the shell. In the dialog, enable Updates → Notify me of a new Ubuntu version.

  • It will check the Ubuntu repositories and if your Ubuntu can be upgraded you will be notified in a while.

  • Note that this upgrade will take a long time, it took 6 hours on my system. It will try to upgrade all your applications and libraries and finally the OS. So, if you want to speed up the process, just remove all applications and libraries that you can beforehand. You can reinstall them after the upgrade.

Fresh install

An upgrade actually takes a very long time to finish. Since Ubuntu installs in as little as 15 minutes on current computers, I do not think an upgrade is always worth the time. Instead make sure that your / and /home are on different partitions. In such a setup, you can just do a fresh install of the new Ubuntu version by wiping out the / partition and by requesting it to use the existing /home partition. This is one of the useful features of Linux installations and I highly recommend keeping these partitions separate for this reason on all computers.

How to create Windows installer USB stick using WinUSB

A USB thumb drive with Windows ISO on it can be used to install Windows newly or repair an existing installation of Windows. Such a bootable USB stick can be created easily on Ubuntu:

  • Prepare the ISO of the version of Windows you want to install or use. For example, the Windows 10 ISO can be obtained here. If you are upgrading from a Windows 7 or 8, you can find out which version you are allowed to upgrade to here (check the Upgrade Editions section).

  • Note that common tools like Startup Disk Creator or UNetBootIn can only create installer USB sticks for Linux operating systems. They cannot be used for installing Windows.

  • An easy tool to create an installer USB thumb drive for booting Windows is WinUSB. It can be installed from a PPA:

$ sudo add-apt-repository ppa:colingille/freshlight  
$ sudo apt-get update  
$ sudo apt-get install winusb
  • Plug in your USB stick, open WinUSB and create a bootable Windows installation media.

You should be able to boot up using this USB stick.

Tried with: WinUSB 1.0.11, Windows 10 x64 and Ubuntu 14.04

How to update Ubuntu LTS Enablement Stack

Ubuntu LTS releases, like 14.04 are supported for many years. However, the kernel and X server that ship with them are only updated for minor changes or revisions during this period. Every six months Ubuntu puts out a new point release for its recent LTS, like 14.04.2. This has the kernel and X server from the most recent Ubuntu non-LTS release.

The Ubuntu LTS Enablement Stack provides these updated Linux kernels and X server releases for users running older LTS releases. For computers with NVIDIA graphics cards, I have found that switching to newer kernel and X server has always improved the driver errors I face.

The LTS Enablement Stack webpage has the charts of what kernel and X server versions are available for your LTS release. You can also find the command to update your LTS from there.

For example, I updated my 14.04 system using this command:

$ sudo apt-get install --install-recommends linux-generic-lts-vivid xserver-xorg-core-lts-vivid xserver-xorg-lts-vivid xserver-xorg-video-all-lts-vivid xserver-xorg-input-all-lts-vivid libwayland-egl1-mesa-lts-vivid

My kernel was updated from 3.13 to 3.19 after this. Remember to reboot after this command! 😄

Tried with: Ubuntu 14.04

How to make startup disk from ISO using Startup Disk Creator

You need a startup disk or USB flash drive loaded with Ubuntu to install it on a new computer. Ubuntu can be downloaded as an ISO file. The Startup Disk Creator tool can be used to create such a startup disk from a ISO file.

Install

Startup Disk Creator will be present on a Ubuntu computer. If by chance you do not have it, it can be installed easily:

$ sudo apt install usb-creator-gtk

Use

  1. Download the Ubuntu (or any other) ISO file you need to make a startup disk from.

  2. Insert the USB stick or drive that you want to use as the startup disk. Note that it needs to be in FAT or FAT32 format! (Otherwise Startup Disk Creator will not show this drive.)

  3. Start the Startup Disk Creator from the Dash or usb-creator-gtk from the shell.

  4. Choose the source disk image (the downloaded ISO file) and the disk to use and click Make Startup Disk.

Once it is done, you can use this USB flash drive to install Ubuntu on other computers by booting from this drive! 😃

Note: An alternative to Startup Disk Creator is UNetBootIn, which can be used as described here. I have faced problems using it for making startup USB flash drives of Ubuntu 14.10.

Tried with: Startup Disk Creator 0.2.56 and Ubuntu 14.04

The disappearing clock in the Panel

Problem

I restarted Ubuntu. After the restart and logging in I discover that the Clock in the Panel is missing! I check and see that the package indicator-datetime is still installed. I open System Settings and go to Time and Date and see that everything in the Clock tab is disabled, so I cannot change it.

Solution

This is a bug in Unity as described here. It is supposedly happening due to a configuration value being reset after packages are upgraded.

Anyway, the only solution that works right now is to kill and restart the Panel service:

$ killall unity-panel-service

This worked for me and my clock was back in the Panel! 🙂

Tried with: Ubuntu 14.04

How to list PPA repositories

The Y PPA Manager is a GUI that can be used to view, add or remove PPA repositories in Ubuntu. If you prefer the shell, the add-apt-repository program can be used to add or remove PPA repositories. However, there is no program that lists the PPA repositories you have added to your system.

Here is a popular shell script that lists PPA repositories:

Tried with: Ubuntu 14.04

How to use Synergy in Ubuntu

20150522_synergy

Synergy is a tool that can be used to share a keyboard and mouse across multiple computers. In this post, I will describe how I used Synergy to share a keyboard and mouse between two computers running Ubuntu.

Install

  • Server is the computer whose keyboard and mouse you want to always use.

  • Client is the computer whose display you want to control using the server’s keyboard and mouse.

  • Make sure the server and client are connected on the same wireless network or LAN. Make sure you can ping the server from the client and the client from the server.

  • Install Synergy on both the server and the client computers:

$ sudo apt install synergy

Setup the server

  • Type Synergy in the Dash or synergy at the shell to open the GUI of Synergy.

  • Choose the Server option. Choose an encryption method from the dropdown and provide a password.

  • In the main dialog, make sure Configure interactively is chosen.

  • Click on Configure server. In the Screens and links tab, you should be able to see a blue display, which represents the server. Drag down the blue display (in the top-right corner) to a box neighboring the server display. This new display you added represents the client. My client display on my desk is to the left of my server, so I dragged the blue display and placed it to the left of the server display.

  • Double-click on the display you added. In the Screen Settings dialog, provide a Screen name to the client. This can be anything, it is just used in the grid of displays. Add an alias: you have to give the hostname or IP address of the client here.

  • Click Start to start the server. It will minimize to the system tray at the top.

Setup the client

  • Type Synergy in the Dash or synergy at the shell to open the GUI of Synergy.

  • Choose the Client option. Choose the encryption method from the dropdown and password that you had used on the server. They have to be the same!

  • In the main dialog, type in the IP address of the server and press Start. Your client is now connected to the server! 🙂

Usage

  • Remember that I have placed my client to the left of the server in the grid. So, when I want to switch to my client display, I hit the mouse to the left side of the display on my server. It will appear in the client! All the keys I type on the server keyboard now appear in the client. To switch back, hit the mouse to the right side of the client display.

Tried with: Synergy 1.4.12 and Ubuntu 14.04

How to suspend in Ubuntu

You can suspend your notebook running Ubuntu by clicking the Gear icon and choosing Suspend. If you want to suspend from the shell, then the relevant command as described here is:

dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true

If you use this frequently, then you can turn it into a script or create a keyboard shortcut for it.

Note: The other methods suggested on the web which use the powermanagement-interface did not work for me on Ubuntu 14.04.

The strange case of the notebook that would wakeup at night

Problem

I would put my notebook running Ubuntu to sleep by closing the lid or by choosing Suspend at night. I could see the display go off, harddisk turn off and keyboard lights go off. However, in the morning I would find this notebook fully active! How was it coming out of suspend mode in the middle of the night?

Solution

The culprit turned out to be a Targus wireless mouse that I had started to use recently. Any slight vibration of the table would awaken this mouse. It would communicate with Ubuntu informing that the user has moved it. So, Ubuntu would come out of suspend mode.

Now I switch off this mouse after I suspend the notebook. The problem has not repeated after I started doing this 🙂

Tried with: Targus AMW071 wireless mouse and Ubuntu 14.04