Ubuntu - Doing Updates
From Blue-IT.org Wiki
Contents
The Problems
A system upgrade via update manager is not working or not intended. Several ppa archives are installed. A complete new installation is needed.
Be warned: I am not responsible for any damage on you system or dataloss. I only can confirm, that I am doing ubuntu updates (formerly debian updates) with this method without any problems since years.
In any case
- Backup or keep your home directory!!!
- Be sure which ppa's you did install and if they are avaiable for your new distribution
- Remember your Username and Password (don't change this)
The best is to keep your home data on a seperate partition. Then you only have to select this partition during a new install and NOT (!!!) to format it.
In case you need a new install of the whole hard disk, this is very easy. Mount an external backup drive or insert a dvd. Save the following files onto that media.
1. Save Package informations
sudo dpkg --get-selections > ~/Desktop/myselections
Save this file to your backup media!
2. Save home
Logout !!!
Switch to a terminal screen via Strg+Alt+F1 and login with your normal username!
Then enter the following commands:
cd /home tar cjvf ~/Desktop/${USER}.tar.bz ${USER}
This creates a file called "yourUserName.tar.bz" on your Desktop.
Switch back to the graphical login screen with Strg+Alt+F7 (sometimes F8) and login.
If you are using evolution email, it is a good idea to backup now your data with the evolution backup procedure which also generates a backup file!
Now burn your backup files (don't forget the myselections file) from your desktop to a CD/DVD and/or - dependent to the size - to a backup drive. Be careful!!! Better save your data twice. A CD or DVD could be defective. The securest way is a backup onto an external hard drive.
3. Install your new ubuntu
You can savely install your new ubuntu using and erasing (!) the whole partition using your old (!) username an password.
4. Recover
After you installed your new ubuntu (you can savely use the whole partition) do the same as above.
Copy back your backupfiles
Login to your new ubuntu with the same (!) username you used before.
Copy the backup of your home directory (yourUsername.tar.bz) and the paket selections (myselections) to your desktop.
Reselect archives
Be sure you reenabled all your ppa archives and all package sources you previously had. Login and copy your backuped files
- myselections
- youUserName.tar.bz
- evt. evolution.tar.gz
to your Desktop.
Replay the backup
Switch to a terminal screen via Strg+Alt+F1 and login with your normal username!
Then enter the following commands:
cd /home tar xjvf ~/Desktop/${USER}.tar.bz cd ~/Desktop/${USER} sudo dpkg --set-selections < myselections sudo apt-get dselect-upgrade
This could take a lot of time depending to your sources.
Switch back to the graphical login screen with Strg+Alt+F7 (sometimes F8) and login with your username / password.
You should be able to login seeing your old desktop environment again.
Troubleshooting
Sometimes your multimedia might not work.
Deletion of the following folders / files might (!) help.
cd ~ rm -rf .pulse