Can't save to X configuration file on nvidia-settings

I’m using driver 470 on Ubuntu 21.10 with Geforce 2060 Super
launch sudo nvidia-settings

Go to X Server Display Configuration to change frame rate to 75 Hz
Click on apply
Save ro X configuration file

But have this : unable to open X config file ‘/etc/X11/xorg.conf for writing’
In terminal have this

$ sudo nvidia-settings
[sudo]     : 

(nvidia-settings:3601): GLib-GObject-CRITICAL **: 10:24:32.167: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 10:24:32.346: PRIME: No offloading required. Abort
** Message: 10:24:32.346: PRIME: is it supported? no
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
Error executing /usr/share/screen-resolution-extra/nvidia-polkit: Permission denied

ERROR: Unable to open X config file '/etc/X11/xorg.conf' for writing.
type or paste code here

How to save configuration?

1 Like

adding x permission to /usr/share/screen-resolution-extra/nvidia-polkit fixed the issue for me

sudo chmod u+x /usr/share/screen-resolution-extra/nvidia-polkit


Hi I am having the same issue. I tried the proposed solution but get cannot access ‘/usr/share/screen-resolution-extra/nvidia-polkit’: No such file or directory .