Score:0

I'm trying to install Stardog on my linux system for some projects but curl isn't working and this is what happens with the documentation

ao flag

documentation: https://docs.stardog.com/install-stardog/linux-installation

$ curl http://packages.stardog.com/stardog.gpg.pub | apt-key add
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
E: This command can only be used by root.
100  1760  100  1760    0     0    581      0  0:00:03  0:00:03 --:--:--   581
curl: (23) Failed writing body
aliza@ingestrom:~$ sudo curl http://packages.stardog.com/stardog.gpg.pub | apt-key add
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
E: This command can only be used by root.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1760  100  1760    0     0   1212      0  0:00:01  0:00:01 --:--:--  1212
curl: (23) Failed writing body
waltinator avatar
it flag
The "`E: This command can only be used by root.`" error lines show that you should `sudo apt-key add` instead of `apt-key add`. The other error "`curl: (23) Failed writing body`" is because `apt-key` has exited, and is no longer listening to the pipe, and `curl` noticed.
FrostBite. avatar
ao flag
Even if I use the sudo command I get the same error message
waltinator avatar
it flag
Comments are designed for US to ask YOU questions about your Question. You should [Edit] your question to add information. By updating your Question, and using the formatting buttons, you make all the information available to new readers. People shouldn't have to read a long series of comments to get the whole story. AskUbuntu is a Question and Answer site, not a conversation site. If you have an update, [edit] your Question. If you have a new question, see [Ask].
waltinator avatar
it flag
[Edit] your question and show us how you "use the sudo command".
Score:1
om flag
aliza@ingestrom:~$ sudo curl http://packages.stardog.com/stardog.gpg.pub | apt-key add

This runs curl as root. But curl only connects to a website (http://packages.stardog.com/stardog.gpg.pub), and outputs the content of that URL to standard output (stdout). That doesn't require any special permissions.

However, the pipe is a separator - you're running two commands; not one. First curl is executed, and stdout of curl is piped to stdin (standard input) of apt-key. The latter command needs root privileges.

The command that complains it has to be ran as root (E: This command can only be used by root.) is apt-key.

Change your command to

curl http://packages.stardog.com/stardog.gpg.pub | sudo apt-key add
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.