5

I am trying to create a new file:

nano/etc/apt/apt.conf.d/02proxy

When upgrading from 14.04 to 16.04, but I'm getting the error:

No such file or directory
  • 6
    Have you tried to run nano/etc/apt/apt.conf.d/02proxy literally? Try it with a space after the command name: nano /etc/apt/apt.conf.d/02proxy. You’ll need root permissions for that. – Melebius Feb 1 '18 at 8:37
5

It seems like there is a typo in your question because there would normally be a blank space between nano and /etc/apt/apt.conf.d/... To create a new file named 02proxy in the /etc/apt/apt.conf.d directory (which normally already exists) open the terminal and type:

sudo touch /etc/apt/apt.conf.d/02proxy  

To open the 02proxy file for editing in nano text editor:

sudo nano /etc/apt/apt.conf.d/02proxy  

Nano text editor keyboard shortcuts
Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location.
Use the keyboard combination Ctrl + X to exit nano.

0

this behavior happen if the target directory doesn't exist. you have therefore to create the parent directory

mkdir my_dir

then use nano.

nano my_file

CTRL x=>y

  • 1
    Creating a directory won't help if you don't put a space between the command (nano) and the file it applies to (/etc/apt/apt.conf.d/02proxy). The OP basically issued nanomy_file instead of nano my_file. – PerlDuck Jul 29 '18 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.