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 wr
It might be possible that the file you are accessing has a swap copy (or swap version) already there in the same directory
Hence first see whether a hidden file exists or not.
For example, see for the following type of files
.system.conf.swp
By using the command
ls -a
And then, delete it using ...
rm .system.conf.swp
Usually, I recommend to start using super user privileges using ...
sudo su