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..."
sleep $RETRY_INTERVAL
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"
# Use -q to suppress "no process found" messages
# Kill any apt-get or dpkg processes that might be hanging
for process in apt-get dpkg; do
pkill -9 "$process" 2>/dev/null || true
done
killall -q apt-get || true
killall -q dpkg || true
killall -9 -q apt-get || true
killall -9 -q dpkg || true
echo "Remove the lock files that may have been left behind"
# Group lock file removal for better readability
@ -318,9 +319,12 @@ jobs:
apt-get clean
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'
#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))
done