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
Pre-append your commands with sudo.
sudo
For example, Instead of vim textfile.txt, used sudo vim textfile.txt. This will resolve the issue.
vim textfile.txt
sudo vim textfile.txt