You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
Bash
49 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
|
|
|
|
function error {
|
|
echo -e "\\e[91m$1\\e[39m"
|
|
exit 1
|
|
}
|
|
|
|
function warning {
|
|
echo -e "\e[33m$1\\e[39m"
|
|
}
|
|
|
|
function check-armhf() {
|
|
ARMHF="$(dpkg --print-foreign-architectures | grep "armhf")"
|
|
}
|
|
|
|
if command -v box86 >/dev/null;then
|
|
echo "uninstalling box86..."
|
|
sudo apt purge box86 -y || error "Failed to uninstall box86!"
|
|
fi
|
|
|
|
echo "removing box86 repo..."
|
|
sudo rm -f /etc/apt/sources.list.d/box86.list || error "Failed to remove repo!"
|
|
echo "removing box86 repo key..."
|
|
sudo apt-key remove "5DBC E818 72C0 609D 3C47 61AA EB3C E9A3 37EC DFA4" || error "Failed to remove key!"
|
|
echo "running 'sudo apt update'..."
|
|
sudo apt update
|
|
|
|
if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ]; then
|
|
|
|
"${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1
|
|
|
|
sudo dpkg --remove-architecture armhf || warning "armhf architecture should be removed by now, but it isn't!"
|
|
check-armhf
|
|
if [[ "$ARMHF" == *"armhf"* ]]; then
|
|
warning "You probably have some other programs using it, remove it by running 'sudo dpkg --remove-architecture armhf'."
|
|
fi
|
|
|
|
elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ]; then
|
|
#32-bit
|
|
true #do nothing
|
|
else
|
|
error "Can't detect OS architecture! something is very wrong!"
|
|
fi
|
|
|
|
echo "running 'sudo apt update'..."
|
|
sudo apt update
|