0

I recently had an error with cinnamon desktop environment that I know how to fix. There is just one stupid obstacle in my way, when I try to use

sudo gedit var/lib/dpkg/status

to go to that folder it takes me to home/var/lib/dpkg/status (not even a folder I have made?) and opens a text document named status with gedit. I need to open computer/var/lib/dpkg/status. This looks and sounds like a stupid thing to me, it probably is, can you even do this? If you can, please tell me how. Also, if this is a duplicate (I don't think anyone else is as stupid as me) please link me the op. Thanks!

  • In addition to fixing the path as kos pointed out, you should use `gksudo` instead of `sudo` when opening a program that uses a graphical interface. See [What is the difference between “gksudo nautilus” and “sudo nautilus”?](http://askubuntu.com/questions/11760/what-is-the-difference-between-gksudo-nautilus-and-sudo-nautilus) – iyrin Apr 06 '15 at 03:45
  • Well ... gksu is depreciated see http://askubuntu.com/questions/284306/why-is-gksu-no-longer-installed-by-default/284717#284717 and https://answers.launchpad.net/ubuntu/+source/gksu/+question/227275 – Panther Apr 06 '15 at 14:29
  • If you don't have `gksu`/`gksudo`, [you can use `sudo -H`](https://askubuntu.com/a/270019/22949) or `sudo -i` instead to run a graphical application as root (and still avoid the problems with plain `sudo`). – Eliah Kagan Apr 06 '15 at 14:47

1 Answers1

0

By omitting / at the start of the path you are specifying a relative path, but you want to specify an absolute path:

sudo gedit /var/lib/dpkg/status

Also, please use gksudo for graphical applications. sudo isn't really fit for that. Like this:

gksudo gedit /var/lib/dpkg/status

See What is the difference between “gksudo nautilus” and “sudo nautilus”?.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
kos
  • 35,535
  • 13
  • 101
  • 151