If I open a text file that needs root privileges to modify, I get this error:
Failed to save 'this_file': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
That's fine, that's expected.
But when I click on "Retry as Sudo", I get this error:
Failed to save 'this_file': Unable to find pkexec or kdesudo.
This happens though pkexec is installed on my machine, at /usr/bin/pkexec; and I granted VSCodium access to it through Flatseal. How do I fix this?
7 Comments
InternetCitizen2@lemmy.world · 3 pts · 1y
Try and open codei as root
sude flatpak run some.thing.codiumDeltaWingDragon@sh.itjust.works · 4 pts · 1y
minor typo spotted
InternetCitizen2@lemmy.world · 1 pts · 1y
lol yeah
You are going to want to run something like
flatpak listto see what flatpak calls the app. It will be a com.something.codium or similar.Then you can open the file by running it as
sudo flatpak run flat.pak.appand then find your file. You should be able to edit and save.It is a bit involved, but usually people will do this via cli text editor and just say
sudo editor file.txt. We need the extra steps here due to gui app.DeltaWingDragon@sh.itjust.works · 1 pts · 1y
Running as root is a forceful workaround, not the solution to my problem. I want to open this lock, not break it.
::: spoiler I don't want to run as root because...
sudoeditvssudo nanoorsudo vim. If you run the editor as root directly, you can access the shell as root. This is a feature, not a bug! But if you runsudoedit, it stays at low privilege level until it actually saves the file.The "Retry as Sudo" dialog is supposed to appear, and when I click on the button, I am supposed to get a password prompt. That's what happens in the Apt version; that's what happens in the Snap version; and in the NixPKG version, they had the same problem, but they fixed it.
How do I fix it in my flatpak version?
InternetCitizen2@lemmy.world · 1 pts · 1y
Hmmm I am not sure. Might be worth asking in one of the mainline linux communities. At a minimum they might be able to point to a more active community instance for asking questions. As it is, this is not really a VSC issue per say.
DeltaWingDragon@sh.itjust.works · 0 pts · 1y
off@programming.dev · 1 pts · 1y
I kept fixing and then kept having new problems with vscdoium in flatpak, either have to give it all permission or give up maybe. As I was using it there would be new problems every once in a while, and different extensions introduced new issues too lol
I gave up and just installed it through AUR.
Even though it's vscodium and not vscode you can run it with
firejail --net=none /sbin/vscodiumand it won't have access to the internetstarshipwinepineapple@programming.dev · 1 pts · 1y
I think you need a polkit authentication agent installed and running to prompt you for your password.
Alternatively you can
sudo codium path/to/file(assuming you have aliased codium to use your flatpak)