Answer the question
In order to leave comments, you need to log in
Why does an error occur when creating a symbolic link?
Hello!
I'm trying to create a symbolic link, but I'm getting the following error:
ln: failed to create symbolic link '/etc/nginx/sites-enabled/doroshchenko.xyz.conf': File exists
mkdir -p /etc/nginx/sites-available/
mkdir -p /etc/nginx/sites-enabled/
nano /etc/nginx/sites-available/doroshchenko.xyz.conf
ln -s /etc/nginx/sites-available/doroshchenko.xyz.conf /etc/nginx/sites-enabled/
ln: failed to create symbolic link '/etc/nginx/sites-enabled/doroshchenko.xyz.conf': File exists
Answer the question
In order to leave comments, you need to log in
Do you already have the /etc/nginx/sites-enabled/doroshchenko.xyz.conf file at the time of running the symbolic link command? As if there is, you need to add the -f option to the command if you want it so that if a file with the same name already exists, it will be overwritten.
It happens because of two dots or when links are placed incorrectly in places. Moreover, he informs you that the link, they say, already exists.
Tried --force, with an explicit indication.
ln -sf /etc/nginx/sites-available/doroshchenko.xyz.conf /etc/nginx/sites-enabled/doroshchenko.xyz.conf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question