2024-04-03, 10:19 AM
I acknowledge that I don't fully understand this system, but I don't understand how cannot it be possible to reinstall some packages, reinstall missing dependencies, or something else.
The idea of starting over everytime some installation is corrupt makes the whole system if not unusable, very annoying to use
I've spent months in having everything working together, and I don't mind spending more time in fixing this issue, but starting over again, configure everything again... I honestly don't know if I have the strenght for it.
If the problem is purely related to the global variable PKEXEC_UID i could run
echo 'export PKEXEC_UID=$(id -u)' >> ~/.bashrc
But that is not the case. ChatGPT suggested me to modify the python script that tries to get the user like this, in order to add a fallback to default user "pi":
Do you think that could be a valid workaround?
The idea of starting over everytime some installation is corrupt makes the whole system if not unusable, very annoying to use
I've spent months in having everything working together, and I don't mind spending more time in fixing this issue, but starting over again, configure everything again... I honestly don't know if I have the strenght for it.
If the problem is purely related to the global variable PKEXEC_UID i could run
echo 'export PKEXEC_UID=$(id -u)' >> ~/.bashrc
But that is not the case. ChatGPT suggested me to modify the python script that tries to get the user like this, in order to add a fallback to default user "pi":
Code:
def __init__(self):
self.user = os.environ.get('USER')
if self.user == 'root':
try:
self.user = os.path.expanduser(os.environ["SUDO_USER"])
except KeyError: # SUDO_USER not set
try:
import pwd
pkexec_uid = os.environ.get("PKEXEC_UID")
if pkexec_uid is not None:
self.user = pwd.getpwuid(int(pkexec_uid)).pw_name
else:
# Handle the case where neither SUDO_USER nor PKEXEC_UID is set
# Fallback to a default or use another method to determine the user
self.user = 'pi' # Or any other fallback mechanism
except KeyError: # PKEXEC_UID not set
# Additional fallback logic here if necessary
self.user = 'pi' # Fallback to a default user or handle differently
self.home = '/home/'+self.user
Do you think that could be a valid workaround?