How to: Edit /etc/sysctl.conf

Hello.

I installed avast on suse 12.2 and after update it gives “invalid argument”. Solution on Ubuntu based distros would be “gksu gedit /etc/sysctl.conf” but I can’t edit the file this way.

Any alternative to “gksu gedit”? I need to open the file as root and edit it.

Thanks in advance

Please tell us what DE & Opensuse version you’re using.

Hi. Isn’t the command default to any DE?

openSUSE 12.2 64bit
XFCE (also installed LXDE and KDE)

On Tue, 22 Jan 2013 02:16:01 +0000, amarildojr wrote:

> Hi. Isn’t the command default to any DE?
>
> openSUSE 12.2 64bit XFCE (also installed LXDE and KDE)

Try gnomesu or kdesu.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Try this command.

xdg-su -c leafpad /etc/sysctl.conf

I am not sure if Alt-F2 works in XFCE, but you need to open a run command to type in this command. “xdg-su -c” elevates you to root, leafpad is the text file editor and of course, /etc/sysctl.conf is the file you say you want to edit.

You may want to look at my fewrup bash script which you can use with your file manager. Just select the text file, then Open With and pick fewrup for any text or system file. If the file belongs to root, a password will be requested. User files will not be edited as root. fewrup works with all DE’s that come with openSUSE.

fewrup - File Editor With Root or User Permissions: https://forums.opensuse.org/blogs/jdmcdaniel3/fewrup-file-editor-root-user-permissions-83/

And a system file editor for KDE and GNOME that has its own file selection menu you can find here:

SYSEdit - System File Editor - Version 1.50: https://forums.opensuse.org/blogs/jdmcdaniel3/sysedit-system-file-editor-version-1-00-60/

Thank You,

Both asked my root passwd and then nothign happened.

Alt + F2 opened Application Finder. Typed “xdg-su -c” and nothing happened. Also “xdg-su -c leafpad /etc/sysctl.conf” output this:

xdg-su -c leafpad /etc/sysctl.conf
xdg-su: unexpected argument ‘/etc/sysctl.conf’
Try ‘xdg-su --help’ for more information.

Is it so hard to open the file as root? =P

you seem to use gedit so i believe you are on gnome.
The following works on my GNOME 3.4.2

gnomesu gedit /etc/sysctl.conf

No, sorry.

I think I would open YaST, search for ** xdg-utils** and install them. Same for leafpad and install it. Then my previous command should work with these installed and they should work with XFCE as I understand it.

Alt-F2: xdg-su -c leafpad /etc/sysctl.conf

Thank You,

Problem solved. After searching about the “sudo nautilus” output (Could not parse arguments: Cannot open display) I could edit the file by

gnome nautilus

Mod can close the thread. Sorry for so many posts, I can’t edit them for some reaon.

Thanks to everybody.

Needs quotes.

 xdg-su -c 'leafpad /etc/sysctl.conf'

Without this, the file name will be interpreted as an xdg option.

That’s very true, **chief_sealth. **

On Tue, 22 Jan 2013 03:36:01 +0000, amarildojr wrote:

> Mod can close the thread. Sorry for so many posts, I can’t edit them for
> some reaon.

The FAQ explains why editing is at most 10 minutes.

We don’t tend to close threads here.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On Tue, 22 Jan 2013 02:56:01 +0000, amarildojr wrote:

> Both asked my root passwd and then nothign happened.

Did you specify the command to execute?

The proper usage would be:

gnomesu -c ‘gedit /path/to/file’

I was saying to run gnomesu instead of gksu.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Wow,
All these suggestions on utilities to modify sysctl.conf and not a single suggestiong to use the sysconfig editor in YAST (System).

All roads lead to Rome, but the YAST tool is good at ensuring proper organization and in many cases syntax and typo errors.

The User should also keep in mind that any sysctl.conf edits might not survive futre upgrades to systemd.
So, I highly recommend docummenting for that future day when you’ll need to know what you did.

TSU

Yes its hard looking up a good command you did not try out for a DE you do not use, but I think I got close perhaps.

Thank You,

100% true. YaST should be the right option for amateurs .

On Wed, 23 Jan 2013 03:26:01 +0000, tsu2 wrote:

> Wow,
> All these suggestions on utilities to modify sysctl.conf and not a
> single suggestiong to use the sysconfig editor in YAST (System).
>
> All roads lead to Rome, but the YAST tool is good at ensuring proper
> organization and in many cases syntax and typo errors.
>
> The User should also keep in mind that any sysctl.conf edits might not
> survive futre upgrades to systemd.
> So, I highly recommend docummenting for that future day when you’ll need
> to know what you did.
>
> TSU

Good catch - as often is the case, it’s easy to get focused on doing
things a particular way rather than looking at the end goal. YaST
sysconfig editor is definitely the right place to start. :slight_smile:

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C