LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-02-2013, 07:59 PM   #1
alkahest
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Rep: Reputation: Disabled
Sudoedit Problem


I would like to edit /etc/apt/sources.list

When I attempted to edit in a text editor, it was revealed that I do not have permission.

So I went to the terminal and input 'sudoedit /etc/apt/sources.list'. I typed in my root password, and then added my new line into the file using the terminal.

When I went to save (still in terminal), and replaced the default filename with 'etc/apt/sources.list', I was told once again that I didn't have permission, despite the fact that I used sudoedit.

What's going on?

Thanks
 
Old 12-02-2013, 08:31 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,497

Rep: Reputation: 442Reputation: 442Reputation: 442Reputation: 442Reputation: 442
no clue what this sudoedit is. there is sudo and there is su - to get you to the root level user. as i can only guess you are running Ubuntu, then you would use sudo, not sudoedit.

Code:
$ sudo vi /etc/apt/sources.list
should do the trick.
 
Old 12-02-2013, 08:35 PM   #3
berndbausch
Member
 
Registered: Nov 2013
Distribution: Redhat, Centos, LFS, Raspbian
Posts: 234

Rep: Reputation: 40
Quote:
Originally Posted by alkahest View Post
When I went to save (still in terminal), and replaced the default filename with 'etc/apt/sources.list', I was told once again that I didn't have permission, despite the fact that I used sudoedit.
This is not how you are supposed to use sudoedit or sudo -e (which is the same). Just make your changes and end your editing session normally without "save as" (e.g., if you are using vi, just :wq).
This is an extract from the sudo man page:

Quote:
3. If they have been modified, the temporary files are copied
back to their original location and the temporary versions
are removed.
By the way, if you really tried to save the temporary file to etc/apt/sources.list, without the leading slash, it's an error I would expect.
 
Old 12-02-2013, 08:36 PM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,123

Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
Quote:
Originally Posted by lleb View Post
no clue what this sudoedit is.
It is just like invoking sudo with the -e option.

Quote:
as i can only guess you are running Ubuntu, then you would use sudo, not sudoedit.
Either should be fine.

Evo2.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do I have a path problem, an Apache2 problem or a Javascript problem or any other pro rblampain Linux - Networking 0 12-29-2010 03:50 AM
The use of sudoedit command question slouching Linux - Security 6 02-23-2010 07:30 PM
Let users to shutdown via sudoedit ? Xeratul Linux - General 8 02-11-2007 11:49 AM
Sound Card problem(every time i install linux i have diffirent hardware problem) jacka1l Linux - Newbie 7 08-11-2005 06:10 AM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM


All times are GMT -5. The time now is 07:38 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration