Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed a program that runs in a browser. I would like to change the background picture it puts up on the screen or modify the existing one. The properties for that file tell me that it is owned by root.

I am running Ubuntu 12.04 really using Linux for the 1st time. I am trying to make the switch from Windows and finding it laborious :-)

How can I change that picture file using the GUI? How do I do this with root privileges?

share|improve this question
    
What is the location of the file you want to modify? –  i08in May 1 at 8:28
    
do You have root privileges? –  user230137 May 1 at 8:30
1  
"and finding it laborious" that is good; just stick with it and if needed ask questions here (if not asked before ;-) ). Do keep in mind: learning another operating systems takes time. Lots of it. –  Rinzwind May 1 at 8:32
    
it is a file within usr/share folder - I do have root privileges (I do know the password) but not sure you can start the GUI with root rights? And thanks for the encouragement - this is the 2nd time I am trying Linux and I know that persistence has its rewards, this time I'm sticking with it but I understand why it's not mainstream yet :-) - Thank you –  user276606 May 1 at 9:59
    
well, it really is the 1st time I am giving it a good try :-) –  user276606 May 1 at 10:00

3 Answers 3

Assuming you are the owner of the operating system in question then you can do something relatively simple. Also assuming the current file is owned by root and group of root then in a terminal you can:

sudo chown your_user:root /path/to/file

You may now edit this file using your normal GUI login.

Once you're done, remember to set it back

sudo chown root:root /path/to/file

To find out more about changing ownership of files see:

man chown

Opening a terminal can be as simple as opening the application bar (name?) and typing "terminal". Using sudo you will be asked for your password to grant you elevated privileges for making the change. See:

man sudo
share|improve this answer
    
The OP would like to have a GUI way of doing this. –  i08in May 1 at 8:33
    
Should be your_user:root instead of your_user.root. –  Jos May 1 at 8:36
    
Thanks Jos, corrected. Jobin, once the file is owned by the current user you can use any GUI tool you wish. Personally I'm not familiar with running GUI tools under sudo (gksudo?), and these would be tool specific so more difficult to describe here. I would recommend this fairly simple process as it limits the possible damage to a system by an unknown tool making changes as root. But this is a personal opinion. –  Drew Anderson May 1 at 8:55
    
Thank you guys I will try this and get back to you - it may take me a couple of days. Thanks for the help! –  user276606 May 1 at 10:05
    
Please don't do this. Just open the file with sudo, don't fiddle with changing permissions. Depending on the process using it, changing the permissions might stop the process from running correctly. –  terdon May 1 at 11:03

Whenever you need to edit something as root, you can use sudo. Press Ctrl+Alt+T to open a terminal and then write this command and hit enter:

sudo gedit /path/to/file

Obviously, make sure to change /path/to/file with the actual location of your file. This will open a gedit (a simple text editor) window run by root (the administrator) and will allow you to edit your file.

share|improve this answer

I'm trying to understand which problem (use case) you actually want to solve.
It looks like you do not actually intend to modify your system files, but to change something in your GUI.
If that's right, see below.


Usually, the best way to make personal changes to files that are part of Ubuntu, is to make a copy of it to your personal files, and modify that. If you can read the file owned by root, you can create a copy, which is owned by you.

Some GUI features even do this automatically in some cases.

As a simple example, if you want to make a change to an existing desktop wallpaper image, you could find the file, copy it, and modify your copy.
Now you can use it as wallpaper image.


(Doing it this way has various advantages, like keeping the original, not creating conflicts when updating the package it belongs to, allowing to do the same for multiple users (and probably more).)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.