Skip to content

Instantly share code, notes, and snippets.

@ninapavlich
Last active August 26, 2022 21:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninapavlich/0bfcfa8ad246ff69b6ec25ebea5c575d to your computer and use it in GitHub Desktop.
Save ninapavlich/0bfcfa8ad246ff69b6ec25ebea5c575d to your computer and use it in GitHub Desktop.
Downgrade to older salt-minion version
#1. Remove the current version and clear app cache
sudo apt-get remove salt-minion
sudo apt-get clean
apt-get autoremove
#2. Create script to view all PPAs:
#Save as script as listppa.sh:
#! /bin/sh
# Script to get all the PPA installed on a system
for APT in `find /etc/apt/ -name \*.list`; do
grep -Po "(?<=^deb\s).*?(?=#|$)" $APT | while read ENTRY ; do
HOST=`echo $ENTRY | cut -d/ -f3`
USER=`echo $ENTRY | cut -d/ -f4`
PPA=`echo $ENTRY | cut -d/ -f5`
#echo sudo apt-add-repository ppa:$USER/$PPA
if [ "ppa.launchpad.net" = "$HOST" ]; then
echo sudo apt-add-repository ppa:$USER/$PPA
else
echo sudo apt-add-repository \'${ENTRY}\'
fi
done
done
#3. View current list of PPAs
sh listppa.sh
#4. Remove old salt PPA from list:
vi /etc/apt/sources.list.d/saltstack.list
#5. Confirm its gone from list
sh listppa.sh
#6. Specify an older version -- visit here for available versions: https://repo.saltstack.com/
sudo wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/archive/2016.3.7/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/archive/2016.3.7 xenial main" > /etc/apt/sources.list.d/saltstack.list
#7. Try installing again
sudo apt-get install salt-minion
#8. Confirm new version
salt-minion --version
@billscheidel
Copy link

For anyone following this in the future, step 6.5 is to run sudo apt-get update to read in the new PPA.

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