IOError: [Errno 13] Permission denied: '/etc/apt/sources.list'

Asked by Tiago J. Pavan

When i try to use source editor I get this error message.

"Distribution: Ubuntu 10.10 maverick
Application: Ubuntu Tweak 0.5.10
Desktop: gnome

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/ubuntutweak/mainwindow.py", line 502, in setup_notebook
    page = module()
  File "/usr/lib/python2.6/dist-packages/ubuntutweak/modules/sourceeditor.py", line 369, in __init__
    self.textview = SourceView(SOURCES_LIST)
  File "/usr/lib/python2.6/dist-packages/ubuntutweak/modules/sourceeditor.py", line 233, in __init__
    self.update_content()
  File "/usr/lib/python2.6/dist-packages/ubuntutweak/modules/sourceeditor.py", line 262, in update_content
    content = open(self.path).read()
IOError: [Errno 13] Permissão negada: '/etc/apt/sources.list'"

I try the last dev version too, 6.00-revxxxx (don't remember now the rev number) and get the same error.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Tweak Edit question
Assignee:
No assignee Edit question
Solved by:
Tiago J. Pavan
Solved:
Last query:
Last reply:
Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#1

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer the following questions which will help us resolve the problem:

1. Is this reproducible?
2. If so, what specific steps should we take to recreate this bug?

We appreciate your response.

Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#2

The message in the last line of the error indicates a permission problem. Were you asked to enter the administrator password and did you typed it correctly?

Revision history for this message
Ding Zhou (tualatrix) said :
#3

Please open your terminal, do the following commands:

  sudo chown root:root /etc/apt/sources.list
  sudo chmod 644 /etc/apt/sources.list

Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#4

Ok, I don't know if this is reproducible, but everytime I try to enter Source editor option, I receive this error message. I don't have even time to enter my admin password. And about the solution Tualatrix say, I already try this and don't work too.
I don't know if this is relevant, but After exit the popup where I receive the error, in ubuntu tweak pannel I see an message about the modules won't loaded.

Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#5

Thank you for sending the details and a screenshot. I'm not Spanish speaking so I won't be able to understand what's in the message box clearly. Could you please translate in English?

Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#6

Spanish? Oh! Isn't spanish, is portuguese. lol
The translation is:

"Ooops... An error occurred.

If you wish to help us solve this problem, please choose
Report to file a new bug report. Be sure to include
the error message below:"

And then, after this text appear the error message hinself.

Hope this help you guys.

Oh! I almost forgot! Thanks for the great app you make here and sorry for my poor english. lol

Revision history for this message
Ding Zhou (tualatrix) said :
#7
Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#8

Yes Tualatrix. I already try this and I don't know why this don't work.

Revision history for this message
Ding Zhou (tualatrix) said :
#9

It's really strange. Please try this command in terminal and give me the result, thanks.

ls -l /etc/apt/sources.list

Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#10

nutri@kazuma-system:~$ ls -l /etc/apt/sources.list
ls: impossible access /etc/apt/sources.list: Permission denied
nutri@kazuma-system:~$ sudo ls -l /etc/apt/sources.list
[sudo] password for nutri:
-rw-r--r-- 1 root root 3812 2011-03-12 04:55 /etc/apt/sources.list

Hope this help in something.

Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#11

OK. I don't know if this is relevant for the issue, but I try something a little odd here, and now everything works fine.

I access the /etc/ folder as root , make a copy of /apt/ folder on my desktop, delete the original /etc/apt/ folder, copy again the folder back from my desktop, apply the commands Tualatrix give me here and now Ubuntu Tweak work perfect.

Maybe this issue at final is something wrong with my system instead of a problem with U-Tweak hinself? I don't really know why this all happens, but hope this is only an isolated issue that don't affect others users after me, and hope you guys stay working to make U-Tweak even better then now.

Great work, congratz for the quick answers you guys give me.

Thanks a lot, again. lol

Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#12

Hi Tiago, I believe it's with the permission to viewing /etc/apt/sources.list that was affected. And yes, after you did copied the file and made a backup of it using root then the permissions were restored.

Thank you very much for reporting this. We will now close this bug report and onvert it to a question since after examining the details, it's a support-related issued. Please change its status as SOLVED or leave it as OPEN if you think it has yet to be resolved.

Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#13

OK, only to finish the tread and put the status as Solved, I discover that this ptoblem occurs after I made a backup of my /etc/apt/ folder to a NTFS partition and get the folder back. I'm a little confused about why this problem occurs, and make all the procedure I made some weeks ago, and the problem start again.
So at final, maybe this is a problem with the permission in final tahta copied from a NTFS partition what make all this mess.

Thanks again for the help you guys give me, and stay with the great work you are doing here with U-Tweak.

Revision history for this message
Tiago J. Pavan (tiagojpavan) said :
#14

OK, only to finish the tread and put the status as Solved, I discover that this problem occurs after I made a backup of my /etc/apt/ folder to a NTFS partition and get the folder back. I'm a little confused about why this problem occurs, then I make all the procedure I made some weeks ago again, and the problem start again.
So at final, maybe this is a problem with the permission in files that copied from a NTFS partition what make all this mess.

Thanks again for the help you guys give me, and stay with the great work you are doing here with U-Tweak.

*Sorry for the duplicated comment. T_T*