I used to use gksudo gedit /etc/something.conf to edit system configuration files but this doesn't seem to work any more. Looks like there is no gksudo in 13.04. How can I add it back or what am I intended to use instead?
7276
I have always recommended pressing ALT+F2 and typing for example gksu nautilus or gksudo nautilus both are equivalent; to run graphical programs with root privileges.  However, I have just installed raring on a test system and this no longer works.  gksu and gksudo are not installed as part of a default raring install; though they are in the repositories. In 12.04 at least gksudo was just a symbolic link to gksu  The reasons I have always done this are because while it is often safe to use sudo under some circumstances it can cause problems with graphical applications because gksu has you running the program as root while with sudo you are running as yourself but with elevated privileges.  This can mean you inadvertently change the owner of critical system files.  This can cause problems.  This reasoning is explained better here:         Why was command removed from a fresh install and what should we be using instead?
13836
System: .    Objective: To define  aliases to launch various  and  text editors while opening a file in  mode from  emulator.    Progress  For example, the following aliases seem to work as expected:  For , in this example I used Nano ():  alias sunano='sudo nano'   For , in this example I used Xed ():  alias suxed='sudo xed'   They both open a file as .    Problem  I have an issue with  in conjunction with :  alias susubl='gksudo /opt/sublime_text/sublime_text'   Sometimes it works. It just does not do anything most of the time.  How do I debug such a thing with inconsistent behavior? It does not output anything. No error message or similar.    Question  gksudo has been deprecated in Debian and also no longer included in Ubuntu 18.04 Bionic, so let me re-formulate this question to a still valid one:  How to properly edit system files (as root) in GUI (and CLI) in Linux?  Properly in this context I define as safely in case, for instance, a power loss occurs during the file edit, another example could be lost SSH connection, etc.
63807
Many sysv init scripts used a corresponding file in /etc/default to allow the administrator to configure it. Upstart jobs can be modified using .override files. How do I override or configure systemd units, now that systemd is the default in Ubuntu?
111797
I'd like to make some changes to my networking configuration by editing my /etc/network/interfaces file. What's the cleanest way to make changes to this file and have them take effect, without having to reboot? Typically, I've been doing:   Edit the file service networking restart   But I have the impression that this isn't the "right" way to make these kinds of changes.
115503
From the actual console (e.g. Ctrl-Alt-F3), I'd like to use sudo loadkeys dvorak .  While that automagically works in Ubuntu, Debian wants me to locate a keymap file.  I don't have the /usr/share/keymaps that is sometimes given as an answer.  find / -type f -name '*dvorak*' turns up a few files which loadkeys won't take.  As in  I do not want to make a permanent change to my system using console-config.  I want to write simple scripts that can change the keymap on the fly.  Is there a package I can install or something?  Since I'd like to swap Caps-Lock and Escape eventually, I should probably , anyway, correct?
23069
I was trying to use gedit, when I came across the following problem:  myPC@TM77:~$ sudo gedit /etc/pm/config.d/config (gedit:12512): IBUS-WARNING **: The owner of /home/myPC/.config/ibus/bus is not root! (gedit:12512): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files   What is happening?
96339
When I run sudo gedit /path/to/some/random/file I get the following error    ** (gedit:6262): WARNING **: Command line `dbus-launch --autolaunch=7f8731869e1c690b8205727e0000000a --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed. Cannot open display:  Run 'gedit --help' to see a full list of available command line options.     Using gksudo doesn't help either which returns    Cannot open display:  Run 'gedit --help' to see a full list of available command line options.     Any help guys. I need to have this capability to open files in Gedit as root. I found this question with the same error but no solution     EDIT I found this post in . These are the instructions:     echo $DISPLAY # you'll be needing this value 3 lines below sudo -i # or "su -" on older Slackwares xauth merge ~alien/.Xauthority # use your own username here instead of "alien" export DISPLAY=:0.0 # use the value of DISPLAY you've seen 3 lines before     On coming to command #3, I got this error xauth:  file /root/.Xauthority does not exist    Maybe this new info can shed more light.
16528
I made a .desktop file for Androxyde's Flashtool (utility for Sony Xperia devices that I have to open with an executable file in its folder) that requires root privileges to use fastboot utilities. I used to make it work with gksu, but I'm on Ubuntu 15.04 and gksu is now old.  I tried to modify the exec line from Exec=gksu /home/natasha/FlashTool/FlashTool to Exec=pkexec /home/natasha/FlashTool/FlashTool Then, I read about pkexec doesn't allow to run X11 applications and so I override in this way:      The problem now is: It asks me the password but the Flashtool's GUI doesn't start. BUT if I execute that command in terminal, the program starts without problems. What can I do?
38711
gedit is set by default to open about any source file. I've gone through the file properties and changed default application to VIM for C and C++ files.  I'd need to do this for any source file I open now, for python files, for text files, for ruby, any, since gedit is set to open all of them.  How can I change this to open with VIM without going the hassle of setting "open with" one by one?
83956
Much as I like Unity and Gnome, getting global keyboard shortcuts and mouse clicks "right" is a source of continual frustration.  We have:   The "settings" dialogs for keyboard and mouse The ccsm tool with chainsaw-like ability to shred your system Unity tweaks (another obscure application) gconf-editor Kernel configuration to access consoles through Ctrl-Alt-Fx I don't know what else.   Recently, I tried to re-assign Super-L to lower a window rather than lock the screen for my 14.04 setup.  We already have Ctrl-Alt-L to lower the screen anyway, I don't need a second shortcut.  But after trying several tools to re-assign the key, I just gave up.  Several layers of assignment all implemented the "same" shortcut, but it isn't easy to figure out which one(s) are actually causing the system to respond as it is.  Without that information, it is hard to reconfigure.    This is a crazy-making setup that makes Linux harder to use than Windows for the average user: Too many arcane ways to set things up, and then a tangle of confusion trying to figure out why anything happens as it does.  How I long for the good old days of fvwm, the simple window manager that could assign any key or mouse click combination to do anything in any context, and the entire configuration was in a single .fvwmrc file! Using Fvwm as the only holder of system-wide shortcuts make life simple, but the multi-layer approach makes Microsoft's regedit seem simple!  It would be wonderful if there were a simple script that could search all the system and user-specific files for a keyword, and report where keypress and mouse-click events matching a pattern are configured.  Ideally, it would support a "universal" keypress and mouse-click description syntax or a GUI, and parse and match that in each of the many configuration files.  A bonus would be if the script could print out a suggestion how to manage the setting with the least potential for inadvertent misconfiguration (for example, helping the user avoid using ccsm when it isn't needed).
28715
I need to edit /etc/sudoers from a script to add/remove stuff from white lists.  Assuming I have a command that would work on a normal file, how could I apply it to /etc/sudoers?  Can I copy and modify it, then have visudo replace the original with the modified copy? By providing my own script in $EDITOR?  Or can I just use the same locks and cp?  The question is more about potential issues than about just finding something that works.
58345
As we all know, to configure the network, we can edit /etc/network/interfaces and execute /etc/init.d/networking restart.  Today I try to use Ubuntu 17.10 and I've found the network configuration had changed. Now we should edit /etc/netplan01-netcfg.yaml and execute netplan apply.  OK, this might be a bad question but I really want to know why Ubuntu did such a change. Is there a strong reason to explain all of changes like this one?
116513
I was trying to solve internet problems, and seem to have made things worse: Now when I start the computer it gets stuck on "Booting system without full network configuration".   Does anyone know how to make it unstuck?   Alternatively: It got messed up when I changed the contents of /etc/network/interfaces, so presumably would work again if I changed it back. How can I edit this file during boot?   I'm using Ubuntu 12.10.
19608
I've read a lot of threads about gksu being removed from many Linux flavours, including Ubuntu 18.04.  Many state that gksu is an abomination and no user should ever need to use anything like it.  I have 2 examples where, as far as I know, I must have something that allows me to run as root (not just for editing files).    First, I have a need to start mysql only after an encrypted folder is opened on (GUI) command.  This means having a script run by the encryption system that starts the mysql service.  That has to be done as root, so I use gksu in that startup script which asks me for a password.  How else can I start a service from a GUI system?  I also run Ubuntu system backups as root, otherwise many system files can't be backed up.  So the desktop file uses gksu to start the backup.  pkexec looks complicated, needing policy files.  Is that the only alternative, and if so, why is it any safer?  Other answers to similar questions don't seem to address individual issues that people have now that gksu is no more (or harder to find...).  I think such questions from non-expert users would benefit from more detailed answers.  I now have some, and so would like to answer my own question.
1269
I have upgraded 14.04 to 16.04 . Now I am trying to open the gedit from terminal by passing the command:    sudo gedit /some/where/file.txt   but it is throwing an error stating that:    (gedit:2090): Gtk-WARNING : Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown:   The name org.gnome.SessionManager was not provided by any .service files**   However, it is opening the file. When I try to save any modification then it is showing this error after saving the file:    (gedit:2090): WARNING : Set document metadata failed: Setting attribute metadata::gedit-position not supported   I am not getting why this is happening in 16.04 only; it was not on 14.04.
83981
Per   I did the following:  ec2run ami-3c994355 --region us-east-1 -n 1 -t m1.large -z us-east-1d   On the machine:  sudo apt-get update sudo apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade   I still get a prompt asking me which config file I want to use. These are the lines that come before the prompt:  Setting up grub-pc (1.99-21ubuntu3.1) ...   then:                           ┌───────────────────────────────────────────────────────┤ Configuring grub-pc ├───────────────────────────────────────────────────────┐                                                        │ A new version of configuration file /etc/default/grub is available, but the version installed currently has been locally modified.  │                                                        │                                                                                                                                     │                                                        │ What do you want to do about modified configuration file grub?                                                                      │                                                        │                                                                                                                                     │                                                        │                                     install the package maintainer's version                                                        │
60686
Reading these questions and answers:        brought me another one that will create problems for new users of that command:   How to configure pkexec for easy usage?   For example when doing the following:  (Opening a file in terminal)     pkexec nano /etc/mysql/my.cnf     (Opening a file in GUI)     pkexec gedit /etc/mysql/my.cnf     The last one gets the following error:   pkexec must be setuid root   Now this brought me the following questions:   How to configure pkexec to avoid getting this? Similar to how sudo/gksu behave when doing the same thing (they only ask for the password). If applicable, how to tell it to not ask for a password after the first time applying it to a command (or including the first command if configurable)? Where to save the configuration file if not yet existing? Is there a GUI app to configure pkexec usage (Policy Kit)?