I have had another question:
Trying to get my wireless dongle working. I’ve found a file it says I have to edit, but the file is read-only, and I can’t change the status in Properties. I’m starting to dislike Linux already 🙁
Editing a read-only file in Linux is easy when you know how. Before you do anything else you copy the original file and paste it somewhere safe, like on your desktop, so if anything goes wrong you can restore it.
Editing the file:
As you are wanting to end up with a file containing an altered load of code there are two ways of doing it:
- The first way is to get superuser permissions to alter the original, then save the changes.
- The second is the longer way. Good if you are nervous about getting something wrong.
The first way
Open a terminal (should be in your list of programmes, will look like old fashioned computer display with a command prompt). The next thing is to open the read-only file from a command in the terminal.
Paste in terminal: gksu gedit /usr/local/share/applications/defaults.list [or your file location]
You can get the location by right-clicking on the file and selecting ‘copy’ then paste it in the terminal. Use right-click ‘paste’ as short-cuts won’t work.
gksu is the super user command, could have used sudo.
gedit is the editor for the document, if your machine uses a different editor put the name of it there instead of gedit.
/usr/local/share/applications/defaults.list is just an example, you put the location of your file there.
You alter the file as you want using gedit. Then save it, while you have superuser or ‘root’ authority over it.
Open the read-only file and paste the contents into a blank gedit. Or open the read-only file and save it to your desktop. Close the read-only one and open the one on your desktop. You will have permissions to alter it. Change what you want then save changes.
Next you want to replace the old one with your altered one.
Paste in terminal after the command prompt: gksu nautilus /usr/local/share/applications/ [or the folder where your file is]
That command would open the file browser but with superuser authority. It will take you to the folder containing your old file. You drag your new file there to replace the old one. Must have the same name as the old one.
If you are not using Ubuntu the file browser may be a different one, but Nautilus is common to many different flavours of Linux. If yours is different put in the name of your file browser.
For someone new to Linux I have good news. A good way to find answers to you Linux questions is to google your question mentioning your version of Linux. As Linux is open source you find all sorts of help out there. People like me stick the answers in websites and blogs.