Created
May 3, 2017 21:03
-
-
Save wesleybliss/be39b93fe6bb99ef8238362338fee691 to your computer and use it in GitHub Desktop.
Restores repos + apps on RPM based distros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE="~/Dropbox/fedora-backups/installed-software-list" | |
echo | |
echo "Are you sure you want to restore DNF repos/configs, and install all packages?" | |
echo | |
echo "You should make a backup first!" | |
echo | |
read -r -p "Really? [y/N] " response | |
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then | |
echo | |
echo "Roger that." | |
echo | |
echo "Restoring DNF (Yum) configs..." | |
sudo /bin/cp -LRf "$BASE/etc_yum.repos.d/*" /etc/yum.repos.d/ | |
echo | |
echo "Installing all packages..." | |
sudo dnf install -y $(cat "$BASE/dnf-installed-packages.log") | |
echo | |
echo "Finished restoring DNF config & packages!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment