gksu Removed From Ubuntu, Here's The Recommended Replacement

Ubuntu 18.04 no gksu

The gksu package, which provides GTK+ front-ends for su (gksu) and sudo (gksudo), was removed from the Ubuntu 18.04 repositories, so it won't be available starting with this Ubuntu release.

gksu is used to allow elevating your permissions when running graphical applications, for example in case you want to run a graphical text editor as root to edit a system file, or to be able to remove or add a file to a system folder.

How to edit system files using a GUI without gksu?


Enter admin://. The recommended way of performing operations that require elevated permissions using a GUI is by using the gvfs admin backend, which is available in both Ubuntu 18.04 LTS and 17.10, by using the admin:// prefix.

All you have to do is open Nautilus, press Ctrl + L so you can type in its address bar, and type admin:// followed by the path of the folder containing the file you want to edit, and enter your password. After doing this, you can use any GUI application to alter system files, like Nautilus to add / delete files or folders, Gedit to edit text file, and so on.

admin instead of gksu ubuntu

Here's an example. Let's say you want to edit the Grub file. Instead of using gksu gedit /etc/default/grub, you can open Nautilus and type: admin:///etc/default. You'll be asked for your password and after you enter it, you can open the grub file with Gedit, then save it.

Note that there are 3 forward slashes after admin: because 2 are required by default and the 3rd is from the path that follows, which begins with a slash: /etc/default. One more thing: in Nautilus, don't enter the direct path to a file but to a folder containing the file you want to edit.

In the same way you can run Gedit from a terminal to open a system file and edit it, for example:

gedit admin:///etc/default/grub

This will prompt for your password and then open the file in Gedit, allowing you to edit it.

2 comments:

  1. Or you can do the old same way.....

    pkexec yourprogram......

    This will behave like straight old gksudo.

    For the die-hard old-timers, you can creat an alias to pkexec named gksudo. It will do.

    ReplyDelete
    Replies
    1. For pkexec, you need policy files or else you cannot use it. For instance, you can get policy files for Nautilus by installing nautilus-admin.

      Delete

Powered by Blogger.