-1

I opened nautilus using $ sudo nautilus / and deleted some files at /usr/share (Discord related files) but after that i tried to open nautilus by clicking the icon and it don't open. i got no idea what happened,i don't think i deleted any files related to nautilus. i can still open nautilus using $ sudo nautilus but $ nautilus returns an timeout. sudo apt-get install --reinstall nautilus-data i ran this command and i still can't open nautilus. anyone have any idea why this is happening and how to fix it? please help me

Ubuntu Version : 20.04 LTS

  • What is the reason for the downvote? The OP's actions may have been unfortunate, but the question is valid. – Jos May 24 '22 at 18:13
  • https://askubuntu.com/questions/11760/what-is-the-difference-between-gksudo-nautilus-and-sudo-nautilus/11766#11766 – Esther May 24 '22 at 18:44
  • Does this answer your question? [Why should users never use normal sudo to start graphical applications?](https://askubuntu.com/questions/270006/why-should-users-never-use-normal-sudo-to-start-graphical-applications) – karel Jun 07 '22 at 09:25

1 Answers1

1

It is a very bad idea to run graphical applications with sudo, as you experience now. Formerly, we had gksudo, and nowadays, legacy graphical applications can be run as root using pkexec. Current idea is never to run graphical applications as root, but program them in a way that they ask the user password and then launch a process in the background that does the action requiring root privileges. Gnome Disks is an example of how this works.

The reason this is happening is that files in your home folder have been given the wrong permissions. It is difficult to tell which.

You could try your chance to solve this by finding files in your home directory that are owned by root, then change the ownership of these files to your own user. The command find ~ -user root will allow you to identify these files.

vanadium
  • 82,909
  • 6
  • 116
  • 186