wget throws a 'missing url' when trying to install a repository signature key

Sad CRUD Developer

I am installing INetSim on Ubuntu and when running this command to install the signature key for the program:

sudo wget -O - http://www.inetsim.org/inetsim.org-archive-signing-key.asc | apt-key add -

I get the message:

wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

Why am I getting this error?

enter image description here

Giacomo1968

The wget command in your question text is not matching the command in your screenshot. Here is the command in your screenshot:

sudo wget -O http://www.inetsim.org/inetsim.org-archive-signing-key.asc | apt-key add -

Here is the command in your example text; also check the command used in the official INetSim installation instructions:

sudo wget -O - http://www.inetsim.org/inetsim.org-archive-signing-key.asc | apt-key add -

Note the subtle difference? The one that is failing is missing the - between sudo wget -O and the URL that follows it. Try it with the - and it should work fine.

Just so you understand what was—or wasn’t—happening, the -O (--output-document flag needed that - to tell wget to stream the contents of that URL to standard output. If you just ran the command like this:

wget http://www.inetsim.org/inetsim.org-archive-signing-key.asc

All wget would do is save that file locally on your system to a file named inetsim.org-archive-signing-key.asc. But setting -O - and then having that pipe (|) to | apt-key add - the command is basically saying, stream the contents of that file to standard put, then pipe that output to apt-key add so the key contents can be added to your apt repository list.

Also, your screenshot shows the additional error:

ERROR: This command can only be used by root.

That is directly related to the lack of the dash in your command; it causes everything else to fail as well.

If the command’s pipe(s) are broken the whole command fails and it will never get to the point where you are prompted to enter the sudo password. But the rest of the command is still being parsed anyway.

So even thought the full command fails it’s still trying to run apt-key. And since the remaining part of the one-line command is basically detached from the rest of the previous sudo invoked command—which never was ever invoked as sudo due to the error—it attempts to run apt-key as a normal user it then says:

ERROR: This command can only be used by root.

Because, yes… Attempting to run apt-key as a normal/unprivileged user is indeed an error.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Cannot write to `-' (Broken pipe) when trying to install a repository signature key

wget missing from cygwin install

npm throws ENOENT error when trying to install module

bad/illegal format or missing URL when deploy from bitbucket repository

chef solo private key missing when trying to use database cookbook

Wget Missing URL in cmd windows 8

"No valid url specified" when trying to install Kibana's Sense plugin

Trying to deserialize a session but no signature validation key specified

Older versions of spaCy throws "KeyError: 'package'" error when trying to install a model

Missing libssl3.so when trying to install Flash Debug Player on Ubuntu 13.10

Helm chart fails with "nil pointer evaluating interface {}" when trying to evaluate a missing nested key

Missing Keyword when trying to Select into

AutoMapper throws Missing Map when Map exists

How to install yum repository key with ansible?

"The IIS Express settings are missing the App Url property" when trying to configure ASP.NET 5 project

AngularJS throws exception when trying to saveChanges with breeze

Plupload throws an error when trying to initiate

EclipseLink throws ArrayIndexOutOfBoundsException when trying to weave a class

Webpack throws error when trying to build JSX

Unable to install kubeadm due to SSL certificate problem when trying to download the Google public key

docker: "Error response from daemon: missing signature key"

kvm: module verification failed: signature and/or required key missing - tainting kernel

Missing key when writing to topic

Error when trying to install GPGME

Error when trying to install wine

Error when trying to install plotly

Error when trying to install pycurl

Composer says ???? when trying to install

Error when trying to install pyautogui