I'm using Ubuntu 16.04 and I tried to open a pdf using evince.
It worked well when I'm logged in the normal user but not when I'm using sudo or switch to root user.
It's all about the permission to access the display server.
Generally, depending on your setup, you may need to allow root to access the xserver . https://askubuntu.com/a/175615/668478
If you run on mir, you should use gksudo to allow root to access mir .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.