I am trying to install apt on my Linux EC2 Micro Instance. I am trying to do as it is mentioned in the first answer of this question. But when I try to edit and save the sources.list file, I am getting the following error.
"/etc/apt/sources.list" E212: Can't open file for writing
I have logged in as ec2-user and changed to root using sudo su -. But Still I am not able to save the file. Can you please help me to fix this.
Best Answer
Can't you do a
? Should work this way. If it does not allow you, maybe you're not in the sudoers file. To include yourself, do
(that should get you in a vi editor with the sudoers config file open). You can edit using the "I" key to start adding text, but first move the cursor just below where it says
From there, as I say, press I and write:
To sabe your changes, press "ESC", ":" and "w", and ENTER. To quit, "ESC", ":", "q".
After editing sudoers, you should be able to try again the
And edit the file normally. Should work.