Skip Navigation

VSCodium can't save file if it needs root privileges (Linux Flatpak)

If I open a text file that needs root privileges to modify, I get this error:

 undefined
    
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:

 undefined
    
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
  • Try and open codei as root

    sude flatpak run some.thing.codium

    • sude

      minor typo spotted

      • lol yeah

        You are going to want to run something like flatpak list to 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.app and 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.

7 comments