check if there is apt and dpkg running

This commit is contained in:
Gustavo Trott 2024-10-26 09:56:07 -03:00
parent 5e4df03283
commit b6a75d1fef

View File

@ -295,14 +295,15 @@ jobs:
echo "Retrying installation within $RETRY_INTERVAL seconds..." echo "Retrying installation within $RETRY_INTERVAL seconds..."
sleep $RETRY_INTERVAL sleep $RETRY_INTERVAL
fi fi
echo "Check if there is some process still locking:1"
ps aux | grep -E 'dpkg|apt'
echo "Stop any ongoing processes related to apt-get or dpkg that might be stuck" echo "Stop any ongoing processes related to apt-get or dpkg that might be stuck"
# Use -q to suppress "no process found" messages # Use -q to suppress "no process found" messages
# Kill any apt-get or dpkg processes that might be hanging # Kill any apt-get or dpkg processes that might be hanging
for process in apt-get dpkg; do killall -9 -q apt-get || true
pkill -9 "$process" 2>/dev/null || true killall -9 -q dpkg || true
done
killall -q apt-get || true
killall -q dpkg || true
echo "Remove the lock files that may have been left behind" echo "Remove the lock files that may have been left behind"
# Group lock file removal for better readability # Group lock file removal for better readability
@ -318,9 +319,12 @@ jobs:
apt-get clean apt-get clean
apt-get autoremove apt-get autoremove
echo "Identify if there is some process still locking" echo "Check if there is some process still locking:2"
ps aux | grep -E 'dpkg|apt' ps aux | grep -E 'dpkg|apt'
#remove all apt-update to make the install faster
sed -i 's/apt-get update/#apt-get update/g' bbb-install.sh
RETRY_COUNT=$((RETRY_COUNT + 1)) RETRY_COUNT=$((RETRY_COUNT + 1))
done done