Skip to main content
added 308 characters in body
Source Link
muru
  • 78.3k
  • 16
  • 214
  • 320

Thinking a bit more on this, you could also make a fake su just for this:

#! /bin/bash /bin/su -s /bin/bash "$@" 

Save it as an executable file named su at, say, $HOME/bin-for-broken-packages/su, and then run:

sudo env PATH="$HOME/bin-for-broken-packages:$PATH" apt install ... 

Thinking a bit more on this, you could also make a fake su just for this:

#! /bin/bash /bin/su -s /bin/bash "$@" 

Save it as an executable file named su at, say, $HOME/bin-for-broken-packages/su, and then run:

sudo env PATH="$HOME/bin-for-broken-packages:$PATH" apt install ... 
Source Link
muru
  • 78.3k
  • 16
  • 214
  • 320

I searched around and found a deb file for this software at https://terpware.umd.edu/Linux/Package/4811. Checking the postinst file extracted from that deb file, I find:

 if [ "$USE_SYSTEMD" ]; then if [ -n "$SUDO_USER" ]; then echo "start GPA for sudo user $SUDO_USER" | tee -a $LOG su -c 'XDG_RUNTIME_DIR="/run/user/$UID" DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus" systemctl --user start gpa' $SUDO_USER elif [ -n "$LOGIN_USER" ] && [ "$LOGIN_USER" == "$EFFECT_USER" ]; then # login user is root echo "start GPA for effect $EFFECT_USER" >> $LOG systemctl --user start gpa & >> $LOG elif [ -n "$LOGIN_USER" ] && [ "$LOGIN_USER" != "$EFFECT_USER" ]; then # su echo "start GPA for login $LOGIN_USER" >> $LOG su -c 'XDG_RUNTIME_DIR="/run/user/$UID" DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus" systemctl --user start gpa' $LOGIN_USER echo -e "\033[1;33mWarning:\033[0m Please switch back to user $LOGIN_USER before you run globalprotect." | tee -a $LOG else # $LOGIN_USER is unknown. Ask for reboot echo -e "\033[1;33mWarning:\033[0m GlobalProtect was installed. Please reboot your machine to bring it up." | tee -a $LOG fi 

It sets USE_SYSTEMD using USE_SYSTEMD="$(pidof systemd || echo '')", so that one's hard to fake. But for SUDO_USER, you could do:

sudo env SUDO_USER=<some-other-user> apt install ... 

Now the question is: which user can you use? There's no point in enabling this for root. Most other system users have /usr/sbin/nologin as their shell. In this postinst file, set -e at the top was commented out, so an error probably doesn't actually cause problems (which I think is confirmed by your question only saying that this error is shown, but not that the installation fails). So you could sub in any random system user, say:

sudo env SUDO_USER=nobody apt install ... 

Then you'd get just this message instead:

This account is currently not available.