|
|
@ -62,7 +62,7 @@ install_deb() {
|
|
|
|
# Define the directory to check
|
|
|
|
# Define the directory to check
|
|
|
|
CACHE_DIR="/var/lib/apt/lists/partial"
|
|
|
|
CACHE_DIR="/var/lib/apt/lists/partial"
|
|
|
|
# Check if the directory exists and was modified in the last 60 minutes
|
|
|
|
# Check if the directory exists and was modified in the last 60 minutes
|
|
|
|
if [ ! -d "$CACHE_DIR" ] || ! find "$CACHE_DIR" -mmin -60 -print -quit &> /dev/null; then
|
|
|
|
if [[ ! -d "$CACHE_DIR" ]] || ! find "$CACHE_DIR" -mmin -60 -print -quit &> /dev/null; then
|
|
|
|
echo "Stale Package Cache, updating..."
|
|
|
|
echo "Stale Package Cache, updating..."
|
|
|
|
# Update package cache with a 300-second timeout for dpkg lock
|
|
|
|
# Update package cache with a 300-second timeout for dpkg lock
|
|
|
|
sudo apt-get -o DPkg::Lock::Timeout=300 -qq update
|
|
|
|
sudo apt-get -o DPkg::Lock::Timeout=300 -qq update
|
|
|
|