1

I need to inspect and repair a Raspberry Pi SD card. This is my main goal. And it should be as simple as possible. It's already bad enough that Windows 10 cannot mount that file system and Android also has no idea about it (but creates random junk on the volume it understands). So I got an Ubuntu disk image and started the live system in VMware. I thought this should be the easiest and quickest solution to get to an environment that can handle a Linux file system.

I plugged in the card reader and it showed up as two volumes on the Ubuntu live desktop as expected. But the file I need to edit belongs to root. The default graphical text editor (it has no visible name) that is started from the default graphical file explorer (also has no visible name) only opens the file as read-only. Saving is not possible.

Smart Windows applications ask me for the required privileges when I want to use them. (Dumb Windows applications still don't.) I thought Linux apps were that smart before. But the editor isn't.

So what are my options to edit that file?

Is going to a terminal and using all the funny text UI tools all I can do now? I'd really prefer a GUI solution because I always forget terminal commands after not using them for a month. And the mount path seems to be unreadable for humans, it's so long I can't see it completely. I found the command gksudo nautilus somewhere around but it's not available on my system.

ygoe
  • 988
  • Not sure how this is a duplicate. I hardly understand the other question, and the answers are highly complicated. If this is what Ubuntu desktop is, I'll probably look for another Linux distro. – ygoe Dec 29 '18 at 13:38

2 Answers2

1

gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.
gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

So, instead of using:

gksudo nautilus

Use:

sudo -H nautilus

or

nautilus admin://
Kulfy
  • 17,696
  • These don't work. The first produces errors and an unusable window size. The second doesn't run anything as root. – ygoe Dec 29 '18 at 13:35
  • @ygoe Can you please elaborate what kind of errors? – Kulfy Dec 29 '18 at 14:30
  • This is what happens: https://imgur.com/a/OyqeU0e Last time I tried, the nautilus window was twice as wide as the screen (not sure why Ubuntu doesn't make it larger, I found no setting for that) and couldn't be operated. This time it became too big as well but could still be operated. – ygoe Dec 29 '18 at 18:20
  • @ygoe What is the resolution and size of your screen? – Kulfy Dec 29 '18 at 20:32
  • My screen has 1920x1200 (probably irrelevant) and the VMware window is still way larger than the screenshot. – ygoe Dec 29 '18 at 23:46
0

The text editor kate let's you edit and save files you don't have write permissions on by entering the sudo password. Since in a live system there is no sudo password (i.e. you can sudo without providing a password), it won't even ask for it, so you can just save all files regardless of the write permissions.

You can install kate in the Ubuntu live system (after enabling the online repositories), but it would be lost on shutdown/reboot.

If you are comfortable with using a different Ubuntu flavour, you can try Kubuntu, which comes with kate pre-installed as the default text editor.

danzel
  • 6,044