Ubuntu offers to upgrade to the next release by the push of a button. It is a convenient way of upgrading but it is also a huge process and many steps can fail, especially if the system was not stable from the beginning.
This guide is for you, who have tried the upgrade without luck. A lot of different problems can arise from a bad upgrade, for example trouble with the screen card, a slow system, network problems, problems with mice and keyboard or a system which simply does not boot.
Whether or not an upgrade is generally safe compared to a clean install is not the topic. If you are reading this, you probably have trouble with an upgrade, and it is not relevant to know how often it works on other machines.
The guide applies to the entire Ubuntu family (Ubuntu, Lubuntu, Xubuntu, Kubuntu...), in short 'Buntu'. It is intended to be a low-tech step-by-step solution suitable for everyone. It does not solve all possible problems, but hopefully it serves as a first attempt. The process is:
1 - Does the machine like the version of Ubuntu to which you are upgrading?
Lack of hardware support is the reason for many failed upgrades. Though the Buntu developers are going great lengths to ensure that a new version works on most hardware there are examples that support is missing in new versions, often because the hardware manufacturer does not provide drivers. Screen cards are the typical problem.
Best is to try the new version in a live boot before installing. A live boot is primarily for testing, it does not change anything on the hard drive unless one decides to do so actively.
If the computer is newer than around 2004 it can boot from a USB memory stick, else you need to boot from CD. In both cases it might be necessary to set the boot order in BIOS.
Buntu has a built-in USB creator and if you want to create the USB stick using Windows Unetbootin is recommended. Best is to download the ISO to the hard drive before running Unetbootin.
Burning a CD should be done with the slowest speed available. Some reports indicate that write-once CD's work better than rewritable ones. Should the boot fail, test the CD itself from the boot menu or try booting another machine with the CD.
Remember that the ISO is one big packaged file and not the installation program itself. Hence one needs to choose 'create CD from image' or similar before burning, not transfer the ISO file itself to the CD.
More on booting from USB, including how to get rid of the annoying U3 software found on some USB sticks:
In Buntu, U3 can be removed using u3-tool found in the repositories.
Sometimes boot options (=kernel parameters) are needed in order to get a particular version running:
The complete list of boot options is here,
but most often you will only need the ones mentioned above.
If that does not work:
2 - Does the machine work with other versions of Buntu?
There are always more than one supported release of your Buntu version. They can be very different regarding hardware support, so don't take for granted that the newest always is best. If your first pick does not behave try some of the other releases. Never install an unsupported release, though.
The fastest way of getting an ISO is through a torrent, but you can also download them from here:
https://launchpad.net/ubuntu/+cdmirrors or from the drop-down lists at the orange menu bar of Ubuntuforums.
Another - and often better - solution is trying one of the other members of the family:
Xubuntu Lubuntu Kubuntu Ubuntu
In most cases there are workarounds for the missing hardware support, first of all the boot options mentioned above, but that is outside the scope of this guide. As a first step, ask our friend Google.
Ubuntu used to be a light operative system, but the latest releases are heavy and put quite a demand on the graphics card. Here's a selection of advice for old hardware.
Some people skip this point and cling to the newest release (and to Ubuntu) demanding it to work, no matter what, simply because it is the newest. This means asking for problems.
Remember that the release of a new version of Buntu (or Windows or Mac OS) has nothing to do with passing of a certain quality test. On the contrary, the system is released as good as it gets at a date decided upon many months before. Before wasting too long time beating the newest release to obedience, consider staying with the old one fro as long as it's supported.
If that does not work:
3 - Is there a hardware problem on the machine?
Bad memory blocks can give a lot of strange symptoms. When booting a live Buntu, one gets the option of testing the memory. It's good to let the test run for an hour or more.
If the test indicates errors, best is to take out the RAM sticks one by one and repeat the test to isolate the error. Beware of static electricity when doing this.
Problems with keyboard and / or mice freezing are sometimes related to the BIOS. Check that you are using the newest BIOS release.
If you have the slightest doubt of the conditions of the hard drive(s), best is to erase everything with Killdisk before installing.
Just burn the Killdisk ISO to a CD (like with Buntu) and boot from it.
When you are adding a used disk to the system, you should always clean it first, especially if it has been used in RAID.
If Killdisk does not run it is likely that the hard drive has physical errors and should not be used.
If that does not work:
4 - Ask the forum
If the machine still does not boot a live Buntu it is time for posting a question in the relevant forum. Remember to write everything you know of the hardware and describe thoroughly the attempts you have done. You could also try a live boot of Knoppix, Puppy or other Linux distros for comparison.
If you are posting for the first time, take a look at this:
Assuming that a live boot works now:
After these steps we know that the desired version of Buntu works on the hardware in question when booted in a live environment, but the attempted upgrade did not. This gives us two options: Trying to fix the problem(s) or installing a new Buntu from scratch.
It is not possible to give advice on solving specific problems in this general guide. However, if one decides to do a clean install these are the steps:
5 - Back up important files
The /home directory contains user files. They must be copied to a safe location, for example a USB drive.
/home also contains hidden configuration files and directories, indicated by a name beginning with a . (dot). Also these should be copied to the backup drive. With control + h, most file managers will show hidden files.
In addition to this it is wise to back up /etc/X11/xorg.conf, if the file is present.
Note: If /home sits on its own partition, it is strictly speaking not necessary to back up any of its files since it is possible to delete only the other partitions and keep this one. Nevertheless, a backup is always a good precaution against Murphys Law.
If you can, best is to physically remove the backup drive from the system before proceeding.
If the installed system is unstable or simply FUBAR the back up can be done in a live boot.
6 - Create space for the new installation
If you don't want to keep anything from the hard drive, just skip to the next step and let Ubuntu wipe the entire drive during installation.
If the machine has one or more operative systems next to Buntu (for example Windows or Mac OS) and you want to keep it/them, boot the live CD again. Open the program Gparted and delete only the Buntu partitions.
If you have a separate /home partition and want to keep it as described above, take care when deleting!
7 - Installation
Remove all unnecessary USB devices before installing, but keep the internet cable attached.
Boot with the Buntu version of your choice and follow the instructions on screen. If a question does not make sense to you just follow the defaults.
If you have a separate /home partition, check that you have not selected it to be formatted during install.
If the normal ISO gives trouble during installation the first step is trying the alternate (text-based) ISO in stead. The finished system will be the same, the only difference is that the installation process itself has another look and feel. Unfortunately it is now only available for Lubuntu.
During install Buntu offers to add closed-source drivers automatically. Normally this is convenient, but if you encounter unexplainable problems try an install without this option.
8 - User files
Now the new system is ready for use, and it is time to copy the user files (documents, music, film,...) back to the /home/<username> location. Keep the config files on the backup drive but don't use them unless you are absolutely sure what you are doing.
Beware that some program pollute /home with a lot of (often hidden) garbage files which do not serve any purpose and only takes up space. Because of this I recommend to copy only select files into the new /home and not the entire folder.
Now you should have a working installation. I hope you also had fun in the process and learned something.
Well, I get your point, but I have installed so many applications on my system that a clean install is basically out of the question.
This goes around a lot in the fora. I believe that the wording ought to be "I have installed so many applications on my system that an online upgrade is basically out of the question". Here is why:
A) The more modified a system is, the more you can assume that an upgrade of this particular system has not been tested by the developers.
One of the blessings of free and open source software is the abundance of available applications. By all means give them a test, but remember that this moves your system further towards one-of-a-kind.
If one of these applications does not run in the new Buntu release or if the upgrade of this particular application has not been thoroughly tested the whole process could fail leaving the system in a neither-nor state.
A customisation does not need to be very exotic to disturb the upgrade. Changing drivers for the graphics card or adding a personal package archive to the Software Sources might be enough.
B) There can be many good reasons for leaving an old application and switching to something different.
Default applications are not switched 'just because' in Buntu. Before changing apps a long debate is going on in the community and all arguments pro and contra have been considered. In stead of complaining that a particular app is no longer installed by default it might be worthwhile to give the successor a chance to prove its worth.
C) Are all your applications actually needed, or are they just there because you installed them once and forgot about them? For people like me who end up with a lot of unneeded applications on the system over time ('they might come in handy some day' - but seldom do), it is actually good to begin from scratch and actively select the applications rather than bringing them along to another version. If you need a list to remember what was installed in your old system it is a sure sign that you had too much.
If you in spite of this want to keep exactly the same packages in the new Ubuntu installation, there is an alternative to the online upgrade. Running the command
gives a text file with all installed packages on the system. If you run this command on the old system you will have the option of running
dpkg --get-selections > installed-software
on the new system after a clean install and get the same selection of packages. Thanks to bcscomp for this suggestion.
dpkg --set-selections < installed-software
If you want to make a complete back-up of both applications and settings before experimenting (and an online upgrade is indeed experimenting), here is some advice:
So... maybe I should have done a clean install, but before I flush the machine, is there one last thing I could try to get it running?
Yes, there are some:
1) Boot the machine (into recovery mode, if necessary) and run
Read carefully the error messages, if any. The solution might be explained here.
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade
If the problem is lack of space then
is worth trying.
sudo apt-get autoremove
2) Rebuild your /etc/apt/sources.list
Make a backup copy of the file mentioned above and build a new one using
Select all branches, updates and third-party repositories that may have been on the system. After applying the new sources.list, run again the three apt-commands above.
Thanks to artoonie for this idea.
Enabling the "proposed" repository will give you access to more bug fixes, but they are in an experimental stage. It could solve the problem, but it could also create another one. Be careful here.
3) Boot into an older kernel.
In the boot proces you might see a list of available kernels. Try going through them step by step and test if one works.
If the list does not appear by itself, repeatedly pressing left-shift early during boot will show it, provided you have the Grub 2 boot loader. If your initial install was Ubuntu 9.10 or later, you have Grub 2 - if it was older than 9.10, it is most definitely time for a reinstall.
4) If you can boot into a command prompt but not the graphical environment, you could try the command startx.
5) Adding boot options as described earlier in this post is also worth trying.