LinuxQuestions.org
Help answer threads with 0 replies.
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 03-11-2014, 03:45 AM   #1
symowallo
LQ Newbie
 
Registered: Mar 2014
Posts: 4

Rep: Reputation: Disabled
Cannot edit /etc/apt/sources.list even as root Debian/OMV


I know this question's been asked before, and I have tried using su -, sudo, sudoedit, sudo nano, sudo sh and various other combinations.

I have OpenMediaVault, which is basically Debian as an appliance. I am attempting to edit /etc/apt/sources.list in order to get Plex working, but no matter which way I try, it will not let me save sources.list - it's always a permission error. I have not modified the permissions for the file in any way whatsoever.

Can someone please advise how I go about modifying the file? I have root access, via putty. I have also tried editing the file via webmin's GUI - no luck.

Thanks in advance
 
Old 03-11-2014, 05:05 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
If you've root access on that machine, then definitely you can edit the file as root user. On the other hand, there is no point of using su until you do not have sudo privileges. In that condition, add your user into /etc/sudoers file and give it access to modify system files or even ALL access.
 
Old 03-11-2014, 06:46 AM   #3
symowallo
LQ Newbie
 
Registered: Mar 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi shivaa, I definitely have root access and I definitely cannot edit the file.

Currently my /etc/sudoers file shows:

Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Allow members of group sudo to execute any command
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Is this what you were referring to?
 
Old 03-11-2014, 06:59 AM   #4
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Can you tell us exactly what you typed on the terminal in order to edit the /etc/apt/sources.list file. Also tell us how the system responded to that command.
Can you post the output of the this command:
Code:
ls -l /etc/apt/sources.list
jdk
 
Old 03-11-2014, 07:26 AM   #5
symowallo
LQ Newbie
 
Registered: Mar 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yep, here goes.

Logged on as root

nano /etc/apt/sources.list

At the bottom of the GNU nano screen, it states [Read 15 lines (Warning: No write permission)]

I get the same results using the same command after typing su (enter) then the above, and sudo sh as well

Here's the output from the command

# ls -l /etc/apt/sources.list
-rw-r--r-- 1 root root 713 Mar 1 00:17 /etc/apt/sources.list

Thanks for the help!
 
Old 03-11-2014, 10:36 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by symowallo View Post
# ls -l /etc/apt/sources.list
-rw-r--r-- 1 root root 713 Mar 1 00:17 /etc/apt/sources.list
Permissions are okay. In the meantime, once change it's ownership to your normal user, let's say user symowallo, as:
Code:
~# chown symowallo:symowallo /etc/apt/sources.list
And then try to update the package again (using aptitude update or the way you were trying).
If it doesn't work, then as root user, modify the /etc/sudoers file and add following line to grant full permission to your user symowallo (line marked in red in below example; Note: Do it very carefully).
Code:
Defaults env_reset
 
# Host alias specification
 
# User alias specification
 
# Cmnd alias specification
 
# User privilege specification
 root ALL=(ALL) ALL
 symowallo ALL=(ALL) ALL
 
# Allow members of group sudo to execute any command
 # /etc/sudoers
 #
 # This file MUST be edited with the 'visudo' command as root.
 #
 # See the man page for details on how to write a sudoers file.
 #
After this try to edit the source.list file.
 
Old 03-12-2014, 05:25 AM   #7
hayya123
LQ Newbie
 
Registered: Mar 2014
Posts: 5

Rep: Reputation: Disabled
if u have root access on root machine the yoy definately access that root.
 
Old 03-12-2014, 05:38 AM   #8
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,522

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Filesystem mounted read-only?
 
Old 03-12-2014, 12:13 PM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
ACLs?
 
Old 03-12-2014, 12:22 PM   #10
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 279Reputation: 279Reputation: 279
My first guess would be that the rootfs is mounted read-only.
 
Old 03-12-2014, 01:25 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853
If you have root access there is no point at alll to fiddle with sudo configuration. Please provide the output of
Code:
mount
 
Old 03-16-2014, 01:58 AM   #12
CitizenJ
LQ Newbie
 
Registered: Mar 2014
Location: Melbourne, Australia
Distribution: OMV (Debian-based)
Posts: 2

Rep: Reputation: Disabled
@symowallo, you are not alone. Other OpenMediaVault (OMV) users have encountered the same problem.

It turns out the OMV maintainers decided to lock the 'sources.list' file after the installation of any Extras because people were "messing it up." Seems a bit heavy handed but I guess there are only a few maintainers versus a massive user community so they need to "idiot-proof" the distro as much as possible.

Anyway, the following threads should help:
http://forums.openmediavault.org/vie...hp?f=12&t=3855
http://forums.openmediavault.org/vie...php?f=3&t=3886

The bottom line is you need to create your own '<some other name>.list' file under '/etc/apt/sources.list.d/' , add the repository references you need to that file then tell apt about them by running 'apt-get update'. It worked for me

Joined specifically to help with this question, so hope it proves useful. Good luck.
 
Old 03-25-2014, 09:48 AM   #13
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Thanks for the heads up CitizenJ

OMV is Linux so the locking mechanism should be standard Linux. What is the output of
Code:
getfacl /etc/apt/sources.list
 
Old 03-27-2014, 03:59 AM   #14
symowallo
LQ Newbie
 
Registered: Mar 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the replies everyone, I really appreciate it. I've not been able to get back to this due to absence... However I am back.

Mount output below, although I think the OMV locking down of the file is the culprit. I really tried to find others with this issue and now I feel silly because others have had the problem and I somehow didn't find the answer - ah well.

I'm now creating my own list to deal with this, as CitizenJ mentioned.

Thanks so much for the help thus far, not solved yet but I am giving it a go now.

/dev/sdf1 on / type ext4 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw)
/dev/mapper/WD--3TB-movies on /media/68d7e7bf-0a66-468f-a892-13b2f38ffb8c type ext4 (rw,noexec,_netdev,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0)
/dev/mapper/WD--slow--2-music on /media/96ff26b7-6fd2-46a4-8be3-42c643c4e3f2 type ext4 (rw,noexec,_netdev,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0)
/dev/mapper/raid1-critical--raid1 on /media/f3f75da4-5ae4-4bb4-ab84-44d66de4329e type ext4 (rw,noexec,_netdev,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0)
/dev/mapper/WD--slow--1-misc on /media/b780b9dc-be8c-453e-88d2-2b5010c775f6 type ext4 (rw,noexec,_netdev,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0)
/media/68d7e7bf-0a66-468f-a892-13b2f38ffb8c/videos on /home/ftp/videos type none (rw,bind)
/media/68d7e7bf-0a66-468f-a892-13b2f38ffb8c/videos on /export/videos type none (rw,bind)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
 
Old 11-25-2014, 04:28 PM   #15
massareal
LQ Newbie
 
Registered: Nov 2014
Posts: 1

Rep: Reputation: Disabled
Question Same here and no clue what is locking my files

/dev/sdb1 on / type ext4 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw)
/dev/mapper/MEDIA-MEDIA on /media/01f40836-07c4-4839-a8f5-7e3b8ce41c51 type ext4 (rw,noexec,_netdev,acl,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0)
/media/01f40836-07c4-4839-a8f5-7e3b8ce41c51/lost+found on /home/ftp/Downloads type none (rw,bind)
/media/01f40836-07c4-4839-a8f5-7e3b8ce41c51/lost+found/Series on /export/Series type none (rw,bind)
/media/01f40836-07c4-4839-a8f5-7e3b8ce41c51/lost+found/nzb on /export/NZB type none (rw,bind)
/media/01f40836-07c4-4839-a8f5-7e3b8ce41c51/lost+found/Movies on /export/Movies type none (rw,bind)
/media/01f40836-07c4-4839-a8f5-7e3b8ce41c51/lost+found/music on /export/Music type none (rw,bind)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
 
  


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
How to edit files in directory /etc/apt/sources.list.d/ in ubuntu 11.10 zdwc01 Linux - Newbie 3 12-06-2011 03:50 PM
Unable to edit /etc/apt/sources.list JudgeMonkey Linux - Newbie 6 12-19-2007 11:24 PM
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
Edit My Apt Sources List carlosinfl Debian 19 08-26-2005 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 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