Error No Write Permission For File /etc/apt/sources.list
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Unable to edit /etc/apt/sources.list file up vote 4 down vote favorite 1 When I try to edit sources.list file using the command: $:gksu gedit /etc/apt/sources.list It request for administrative password and when I type the password, It says incorrect and try again.What to do? I am new to Linux or Ubuntu. 13.04 software-sources share|improve this question edited Nov 29 '13 at 12:49 asked Aug 14 '13 at 19:43 rajashekar007 771112 2 Are you using your current password? If so, does your account have administrative privileges? Welcome to AskUbuntu. –Geppettvs D'Constanzo Aug 14 '13 at 19:46 Yes,Iam using my current password and account with administrative privileges. bty using nano editor has resolved my problem. Thank you. –rajashekar007 Aug 14 '13 at 20:30 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote accepted Use the terminal text editor program nano instead of gedit to edit /etc/apt/sources.list. Open the terminal and type: sudo nano /etc/apt/sources.list The instructions for using nano are always displayed at the bottom of the page. Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location. Use the keyboard combination Ctrl + X to exit nano. You can also use the terminal program vim to edit text files, but nano is easier to use. share|improve this answer edited Aug 14 '13 at 19:55 answered Aug 14 '13 at 19:45 karel 22.6k95165 Unnecessarily wasted 2 hours of time. Resolved. –rajashekar007 Aug 14 '13 at 20:27 add a comment| up vote 1 down vote Solving the problem: If your root password is correct and you are receiving error from using gksu gedit /etc/ap
Search Tutorials/Articles Search HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie Cannot edit /etc/apt/sources.list even as root Debian/OMV User Name Remember Me? 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 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. http://askubuntu.com/questions/332669/unable-to-edit-etc-apt-sources-list-file Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now 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. Introduction http://www.linuxquestions.org/questions/linux-newbie-8/cannot-edit-etc-apt-sources-list-even-as-root-debian-omv-4175497777/ to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 03-11-2014, 02:45 AM #1 symowallo LQ Newbie Registered: Mar 2014 Posts: 4 Rep: 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
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://unix.stackexchange.com/questions/117535/cant-edit-sources-list-as-root Overflow the company Business Learn more about hiring developers or posting ads with us http://stackoverflow.com/questions/8253362/etc-apt-sources-list-e212-cant-open-file-for-writing Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted error no up and rise to the top Can't edit sources.list as root up vote 1 down vote favorite I cannot edit/move/delete the sources.list file, despite being root. When I do ls -la /etc/apt it reports this: root@nibelung:~# ls -la /etc/apt/ total 356 drwxr-xr-x 6 root root 4096 Feb 28 21:30 . drwxrwxr-x 100 root root 4096 Feb 28 01:29 .. -rw-r--r-- 1 root root 98 Aug 24 2013 apt.conf drwxr-xr-x 2 root root 4096 error no write Feb 27 14:04 apt.conf.d -rw-r--r-- 1 root root 123 Feb 28 01:52 preferences drwxr-xr-x 2 root root 4096 Feb 27 21:01 preferences.d -rw------- 1 root root 0 Aug 24 2013 secring.gpg -rw-r--r-- 1 root root 878 Jan 24 19:30 sources.list -rw-r--r-- 1 root root 0 Sep 27 02:00 sources.list~ -rw-r--r-- 1 root root 878 Feb 28 21:30 sources.list.bk drwxr-xr-x 2 root root 4096 Feb 27 21:01 sources.list.d -rw------- 1 root root 1200 Jan 24 15:03 trustdb.gpg -rw------- 1 root root 158664 Jan 24 15:03 trusted.gpg -rw------- 1 root root 158664 Jan 24 15:03 trusted.gpg~ drwxr-xr-x 2 root root 4096 Apr 15 2011 trusted.gpg.d debian permissions root share|improve this question asked Feb 28 '14 at 19:38 svart 407 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted When you try to edit it, what happens? What error do you get? Things to look at first: Is the filesystem mounted read-only? (check mount) Is the file immutable? (check lsattr sources.list; if it's set +i, chattr -i sources.list) share|improve this answer answered Feb 28 '14 at 19:46 DopeGhoti 10.8k21228 Yes, it was immutable thank you! –svart Feb 28 '14 at 19:48 Out of curiosity, which was it; the filesystem or immutability? –DopeGhoti Feb 28 '14 at 19:50 add a comm
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up /etc/apt/sources.list" E212: Can't open file for writing up vote 73 down vote favorite 23 I am trying to edit sources.list using vi editor but getting the following error while saving the file: /etc/apt/sources.list" E212: Can't open file for writing vi ubuntu-11.04 share|improve this question edited Dec 6 '14 at 1:17 Eric Leschinski 46.6k23221190 asked Nov 24 '11 at 7:12 dragosrsupercool 2,56341950 I got this when the directory I was trying to write the file to exceeded its max. disc usage –Mehdi Nellen May 20 '15 at 11:31 As a comment mentioned in one of the answers, you might get this if folder in which the file resides has been deleted or didn't exist in the first place. Look for commands for changing directory or creating a directory from vi, depending on the situation. –kon psych Sep 8 '15 at 21:41 add a comment| 6 Answers 6 active oldest votes up vote 114 down vote accepted For some reason the file you are writing to cannot be created or overwritten. The reason could be that you do not have permission to write in the directory or the file name is not valid. Vim has a builtin help system, I just quoted what it says to :h E212. You might want to edit the file as a superuser like sudo vim FILE. Or if you don't want to leave your existing vim session (and know have proper sudo rights), you can issue: :w !sudo tee % > /dev/null Which will save the file. HTH share|improve this answer edited Apr 26 '13 at 10:39 Class Stacker 4,36712247 answered Nov 24 '11 at 7:20 Zsolt Botykai 29.9k106485 27 Thanks! In my case it was trying to edit a non-existing file in a non-existing directory. Turns out, while you can "open" non-existing file and then create it by saving it, t