Skip to content

Instantly share code, notes, and snippets.

@erikroyall
Created April 15, 2015 13:40
Show Gist options
  • Save erikroyall/d85a486651ed0c53f5c3 to your computer and use it in GitHub Desktop.
Save erikroyall/d85a486651ed0c53f5c3 to your computer and use it in GitHub Desktop.
Ubuntu Back Up Script
dpkg --get-selections > ~/Package.list
sudo cp -R /etc/apt/sources.list* ~/
sudo apt-key exportall > ~/Repo.keys
rsync --progress /home/`whoami` /path/to/user/profile/backup/here
rsync --progress /path/to/user/profile/backup/here /home/`whoami`
sudo apt-key add ~/Repo.keys
sudo cp -R ~/sources.list* /etc/apt/
sudo apt-get update
sudo apt-get install dselect
sudo dpkg --set-selections < ~/Package.list
sudo dselect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment