Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ssendeavour/5802839 to your computer and use it in GitHub Desktop.
Save ssendeavour/5802839 to your computer and use it in GitHub Desktop.
Linux下备份及重装系统后还原系统设置和软件, 来自 http://askubuntu.com/questions/9135/best-way-to-backup-all-settings-list-of-installed-packages-tweaks-etc
## from http://askubuntu.com/questions/9135/best-way-to-backup-all-settings-list-of-installed-packages-tweaks-etc
dpkg --get-selections > ~/Package.list
sudo cp /etc/apt/sources.list ~/sources.list
sudo apt-key exportall > ~/Repo.keys
rsync --progress /home/`whoami` /path/to/user/profile/backup/here
## Reinstall now
rsync --progress /path/to/user/profile/backup/here /home/`whoami`
sudo apt-key add ~/Repo.keys
sudo cp ~/sources.list /etc/apt/sources.list
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