gpg: can't open `–': No such file or directory
28,547
Solution 1
Your only problem is that the dash after apt-key add
is not the ASCII 0x2D hyphen character, but the Unicode U+2013 en dash. The former instructs apt-key
to read the key from the standard input (where the preceding wget
provides it through the pipe), while the latter is not treated specially, thus interpreted as a file name to read the key from. Unsurprisingly, such a file does not seem to exist in your current directory.
Solution 2
Use this:
wget -qO - http://www.dotdeb.org/dotdeb.gpg | apt-key add -
You need a space after the -O
and the character after add
seems to be wrong. -q
turns off the output of wget
.
Related videos on Youtube
Author by
jordanm
Updated on September 18, 2022Comments
-
jordanm over 1 year
I'd like to install php 56 on my Debian Wheeyz System. So I added the dotdeb repo to apt. While fetching the key, an error occurred:
# wget http://www.dotdeb.org/dotdeb.gpg -O- |apt-key add – # gpg: can't open `–': No such file or directory
What do I have to change to add the key to apt?
-
Yami Odymel over 4 yearsTrue: If you copy the command from the blogs, WordPress converts
-
to Unicode–
as well. -
kreamik almost 3 yearsyou save my life, i just got the same problem and got the tutorial from blog like @yami