how to write in `/etc/profile.d/` ?
I don't have the permission to write in this repository and I can't log into root user because iirc I didn't choose the root user's password at the installation. I need to create a file in this repository for an app to work.
Solution
you can simply try running
sudo touch /etc/profile.d/filename, and when prompted for password, enter your user password. your user should be in the wheel group, and therefore can use sudo. if that succeeds, you can then run sudo nano /etc/profile.d/filename and edit the file