Skip to content

Commit

Permalink
pts-core: Workaround Ubuntu 22.04 apt-get crashing the entire process…
Browse files Browse the repository at this point in the history
… on dependency installation
  • Loading branch information
michaellarabel committed Apr 23, 2022
1 parent 2e07095 commit 61a381f
Showing 1 changed file with 9 additions and 10 deletions.
@@ -1,7 +1,12 @@
#!/bin/sh

# The < /dev/null hacks below added for Ubuntu 22.04 LTS...
# Without them, after years of this script working fine, on Ubuntu 22.04 it manages to crash the entire PHP/PTS process...
# Adding < /dev/null to the apt/apt-get lines seems to workaround this odd new issue on Ubuntu 22.04

export DEBIAN_FRONTEND=noninteractive
if [ `whoami` = "root" ] && [ ! -w /usr/bin/sudo ]; then
apt-get -y --ignore-missing install $*
apt-get -y --ignore-missing install $* < /dev/null
elif [ `whoami` != "root" ] && [ ! -z "$DISPLAY" ]; then
if [ -x /usr/bin/gksudo ]; then
ROOT="/usr/bin/gksudo"
Expand All @@ -10,16 +15,10 @@ elif [ `whoami` != "root" ] && [ ! -z "$DISPLAY" ]; then
elif [ -x /usr/bin/sudo ]; then
ROOT="/usr/bin/sudo"
fi
$ROOT -- su -c "apt-get -y --ignore-missing install $*"
$ROOT -- su -c "apt-get -y --ignore-missing install $* < /dev/null"
elif [ -z "$DISPLAY" ]; then
sudo -- apt-get -y --ignore-missing install $*
sudo -- apt-get -y --ignore-missing install $* < /dev/null
else
su -c "apt-get -y --ignore-missing install $*"
su -c "apt-get -y --ignore-missing install $* < /dev/null"
exit
fi

# if [ -x /usr/bin/aptitude ]; then
# aptitude is nice since it doesn't fail if a non-existant package is hit
# See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503215
# $ROOT -- "aptitude -y install $*"
#fi

0 comments on commit 61a381f

Please sign in to comment.