2

When i insert this: gksudo nano /etc/default/grub

it replies with this:

(gksudo:(4 digit number, always different)): Gtk-Warning **:cannot onpen display:

But if i type sudo nano /etc/default/grub it opens the requested file in nano editor. I've tried to use synaptic package manager to reinstall some stuff, but even after reboot it didn't solve the problem.

Purged the package gksu and reinstalled, problem still exists.

Searched some stuff but nothing appears about a desktop. I'm using a very very old one, with Lubuntu 14.04.03 32bit LTS. This happened after i changed nomodeset in GRUB, but i've already removed that and the problem still affects me.

3
  • Why are you using gksudo instead of plain sudo, since nano is going to need a terminal to run in anyway? Feb 9, 2016 at 23:09
  • yes, i know sudo works well, but i still want to solve this. Feb 10, 2016 at 12:16
  • So are you running this inside your Lubuntu desktop (using lxterminal?) Is DISPLAY unset (echo $DISPLAY)? FWIW, regardless of the error message, I don't think gksudo is going to work for a terminal-based editor like nano. Feb 10, 2016 at 13:01

1 Answer 1

1

If you are just trying to run nano in the terminal gksudo is the wrong command.

If you want to call up another terminal emulator in which to run nano the first thing you need to do is make a launcher

Using your example:

gksudo "lxterminal --command "nano /etc/default/grub""

The graphical frontend of sudo launches a terminal emulator, and then executes the command within that terminal.

1
  • Oh ok, got it. I was using gksudo because i was following the instructions from a website, i didn't even looked properly to what i was writting. Thanks! Feb 11, 2016 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .