sudo -i starts a login shell and should in my understanding read/source
[non-root user home/.profile and
/etc/profile. Adding aliases, e.g.
alias ll='ls -la' to both files doesn't make the alias available in the shell started by
sudo -i. If I run
bash in the shell stared by
sudo -i aliases are available.
I already figured out to put aliases in
/etc/profile.d/00-aliases.sh in https://askubuntu.com/questions/810730/how-to-share-bash-aliases-between-non-root-user-bash-and-shell-opened-by-sudo. Here I just want to know why the expected behaviour doesn't occur.
I reported this as a sudo bug on launchpad.net, but now I'm not sure whether this might be a tricky aspect of expected behaviour. The way
man sudo describes
-i is too trivial anyway.