Cannot edit /etc/apt/sources.list even as root Debian/OMV
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
#
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:
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.
#
@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.
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.
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)
/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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.