Star Hype News.

Premium celebrity moments with standout appeal.

news

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?

1

3 Answers

Use the sudo command to gain root access. For example:

sudo -H /bin/bash
cd /etc/apt
do your editing of files
exit

Good practice is to save a copy of the original files (e.g. Adding a .orig suffix), before editing.

1

One way of doing this is by opening nautilus as root from the terminal:

sudo nautilus

From 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.bak

To move a file into that directory:

sudo cp ~/somefile2 /etc/apt

The ~ 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.