Skip to content

Instantly share code, notes, and snippets.

@sergey-shambir
Last active May 12, 2018 06:59
Show Gist options
  • Save sergey-shambir/fa0d3f99740d251e04d529e220f3fe36 to your computer and use it in GitHub Desktop.
Save sergey-shambir/fa0d3f99740d251e04d529e220f3fe36 to your computer and use it in GitHub Desktop.
Guide: migrate from old Ubuntu LTS to new Ubuntu LTS

Migration steps

  1. Upgrade installed packages: sudo apt update && sudo apt upgrade
  2. Remove all packages installed with checkinstall
    • You can search with Synaptic using 'checkinstall' query
  3. Remove all ppa repositories (see "How to remove PPAs " below)
  4. Run Update Manager and upgrade distribution: sudo update-manager -d
  5. After upgrade, use lsb_release -a to see Ubuntu version

How to remove PPAs

Install ppa-purge: `sudo apt install ppa-purge

Then run the following script to autodetect PPAs and format ppa-purge commands:

#! /bin/sh 
# listppa Script to get all the PPA installed on a system ready to share for reininstall
for APT in `find /etc/apt/ -name \*.list`; do
    grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
        USER=`echo $ENTRY | cut -d/ -f4`
        PPA=`echo $ENTRY | cut -d/ -f5`
        echo sudo ppa-purge ppa:$USER/$PPA
    done
done

You can copy-paste the script above using nano editor: nano listppa.sh. Then use chmod +x listppa.sh to make script file executable, and run ./listppa.sh (without root privilegies)

Script will output PPA list with removal commands, e.g.:

sudo ppa-purge ppa:ubuntu-desktop/ubuntu-make
sudo ppa-purge ppa:ubuntu-sdk-team/ppa
sudo ppa-purge ppa:webupd8team/atom
sudo ppa-purge ppa:thomas-schiex/blender
sudo ppa-purge ppa:lyzardking/ubuntu-make
sudo ppa-purge ppa:zeal-developers/ppa
sudo ppa-purge ppa:ubuntu-toolchain-r/test
sudo ppa-purge ppa:cginternals/ppa
sudo ppa-purge ppa:ubuntu-desktop/ppa
sudo ppa-purge ppa:adrozdoff/cmake
sudo ppa-purge ppa:jonathonf/rustlang

Then copy-paste commands and run them in terminal (either one by one or all together).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment