LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-19-2007, 10:36 PM   #1
JudgeMonkey
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
Unable to edit /etc/apt/sources.list


Ok, so I was recently pulled into the world of linux through my purchase of an EEE pc. So I'm trying to get it setup, I find a tutorial on how to install wine, but it wants me to edit /etc/apt/sources.list. A similar tutorial for dosbox had me do the same.

It first suggests I run konsole to allow pasting.

It then tells me to use the command sudo nano /etc/apt/sources.list

I understand that, I think. sudo (the important part) gives full access to the file, supposedly. nano is the text editor that is being given super user privileges, and /etc/apt/sources.list is the file.

However, I save the file and close it, and when I open it, it is unchanged. I browse to the folder, and I see it is creating sources.list.save, sources.list.save 1, etc... All of these files are marked as owned by the root, I figure sudo rm /etc/apt/sources.list.save* will remove them, but my main concern is an inability to edit the file I want.

I'd login as root just for this process, but don't even know how to do that.
 
Old 12-19-2007, 10:42 PM   #2
Acron_0248
Member
 
Registered: Feb 2006
Location: Venezuela
Distribution: Gentoo
Posts: 453

Rep: Reputation: 33
Hi,


sudo should be able to give the privileges neede unless some sore of unusual configuration on sudoers, however, to become root, open konsole (or any other terminal emulator) and type just su, it will ask you for the root pass, type it and press Enter, from then, you can edit the sources just using nano /etc/apt/sources.list



Regards
 
Old 12-19-2007, 11:03 PM   #3
JudgeMonkey
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Hmm, ok. I type su and it gives the password prompt. I don't know my root password, but i heard someone say on these systems that it's the same as your password. I typed that in and I guess it worked. The prompt changed from /home/users> to eeepc-myname:/home/users>

I tried editing the file with just nano /etc/apt/sources.list and it does the same thing. It seems to change, but when I check it's the same. Sure enough I'm now up to .save 5

I can only guess some config file is unusually configured (the only other thing I've done on this system is use synaptic to install a few essential packs that this computer would be in kid mode without.) it seems like the changes I made with synaptic took.
 
Old 12-19-2007, 11:15 PM   #4
neophytezer0
LQ Newbie
 
Registered: Nov 2007
Location: localhost
Distribution: Slackware
Posts: 21

Rep: Reputation: 15
vi ftw?

I would suggest using vi (or vim) instead of nano. I think what is going on is nano is saving to a different file, which you have to "mv" onto the file you are editing for the changes to take effect. try to view the '.save's and see if those have the changes. if so, do a quick 'mv (file) sources.list' and you should be ok.
 
Old 12-19-2007, 11:19 PM   #5
Acron_0248
Member
 
Registered: Feb 2006
Location: Venezuela
Distribution: Gentoo
Posts: 453

Rep: Reputation: 33
How are you exactly saving changes?

The .save files are emergency files that nano create when it exits suddenly or when it recieves a sigterm o sighup, it appends a number if there's already a .save file.

Do:
Code:
# nano /etc/apt/sources.list
After all changes, press Ctrl + O (read letter "o" not zero 0), it will ask you if you want to save changes, press Enter to save them, and then press Ctrl + X to quit nano.

Read man nano for more info





Regards

Last edited by Acron_0248; 12-19-2007 at 11:20 PM.
 
Old 12-19-2007, 11:20 PM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
I wouldn't recommend simply overwriting critical files anyway. What if sometimes goes wrong ? It's safer to make a copy first and give it a slightly different name, for example adding .bak to the extension, then edit the original.

As for nano, it doesn't work any different from vim. If it created a different file, how would it know what to name it? No, it simply uses the original just as vim does.

Did you use Ctrl+O and Ctrl+X to save your changes?
 
Old 12-19-2007, 11:24 PM   #7
JudgeMonkey
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
I found the problem. You press x to exit, and then yes to save the buffer. It is then asking me what file to save to. I kept assuming it was done and closed the console. I needed to press enter one more time. That's it. I just didn't hit enter enough.

Don't worry, I'll punch myself for you. Dang, I don't think my mother (who keeps making the "any key" joke.) would make such a silly mistake. Thank you all for your help.

I think mv one of the .save files would have worked too, yes.

Also, before i did this I did a cp on the sources.list and made a sources.list.bak

Update: Ah, I see ya'll could tell what i was doing wrong anyway, so if my brain didn't work, well darn. You've got a resolution for even that.

Last edited by JudgeMonkey; 12-19-2007 at 11:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Recommendation for Debian Etch sources.list ( /etc/apt/sources.list ) forgox Debian 6 05-05-2007 02:57 PM
etc/apt/sources.list errors when trying to edit tparker Linux - Desktop 2 11-10-2006 06:45 AM
How can I edit sources.list elementadiobam Ubuntu 9 09-20-2006 10:57 AM
Edit My Apt Sources List carlosinfl Debian 19 08-26-2005 07:13 AM
apt-get update errors since Debian released ( bad /etc/apt/sources.list ?) forgox Debian 10 06-13-2005 01:28 PM


All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration