How do I gain access to the files in the /etc/apt folder? [closed]
By James Williams
I need to do change a filename and copy a file to the folder /etc/apt, but the folder is locked. How do I unlock it?
13 Answers
Use the sudo command to gain root access. For example:
sudo -H /bin/bash
cd /etc/apt
do your editing of files
exitGood practice is to save a copy of the original files (e.g. Adding a .orig suffix), before editing.
1One way of doing this is by opening nautilus as root from the terminal:
sudo nautilusFrom there, proceed as you have tried before, change the filename and copy your file
To change a file name:
sudo mv /etc/apt/somefile /etc/apt/somefile.bakTo move a file into that directory:
sudo cp ~/somefile2 /etc/aptThe ~ supposes that the existing file is in your /home/user directory. If it is somewhere else, for instance Desktop, then:
sudo cp ~/Desktop/somefile2 /etc/apt Please proceed with caution and ask for clarification if needed.