我在 Ubuntu 16 上,我想添加 neo4j 包。我尝试了 3 种方法,但都导致相同的错误。
这些是我的尝试:
wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -
sudo wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -
sudo -i wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -
但我总是收到这个错误信息:
ERROR: This command can only be used by root.
--2016-11-04 http://debian.neo4j.org/neotechnology.gpg.key
Resolving debian.neo4j.org (debian.neo4j.org)... 52.0.233.188
Connecting to debian.neo4j.org (debian.neo4j.org)|52.0.233.188|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4791 (4,7K) [application/octet-stream]
Saving to: ‘STDOUT’
- 0%[ ] 0 --.-KB/s in 0s
Cannot write to ‘-’ (Broken pipe).
答案1
您需要将 wget 命令从:
wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -
到:
wget -O - http://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
答案2
错误消息来自apt-key
,并且正如它所说,将其与一起使用sudo
:
wget -O - http://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -