/etc/environment and /etc/profile.d/* ignored for the root user [duplicate]

You will need to get into a real root login shell:

sudo su -