
https://example.com
そのコマンドを使用してダウンロードしたいが、wget
「サポートされていない/認識できないプロトコル」が表示されます。試してみましたが動作--secure protocol=''
しません。 GNU wgetからtarファイルをダウンロードして設定しようとしましたが、失敗しました。
私が見ているものの例は次のとおりです。
bash-2.05$ wget https://www.facebook.com/
https://www.facebook.com/: Unknown/unsupported protocol.
bash-2.05$
こんにちは皆さん、ご回答いただきありがとうございます。以下のように私のwgetバージョンを確認しました。
bash-2.05$ wget -V
GNU Wget 1.6
Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Originally written by Hrvoje Niksic <[email protected]>.
私のwgetがSSLにコンパイルされているのか、SSLが有効になっているのかわかりません。このコマンドをコンパイルする方法を教えてくださいwget
。ファイルを実行configure
してmake
コマンドを入力しましたが、コマンドが見つからないというエラーが発生しました。プロファイルを実行したwget
後も/usr/local/
。
bash-2.05$ cd wget-1.10.1
bash-2.05$ ./configure --prefix=/usr/local --with-ssl
bash-2.05$ make
bash: make: command not found
私がダウンロードしたバージョンは
wget-1.10.1.tar
答え1
解決策
wget
SSLサポートが有効な状態でバイナリがコンパイルされていることを確認してください。与えたコマンドを試したときの結果は次のとおりです。
$ wget https://www.facebook.com
--2015-07-19 15:27:17-- https://www.facebook.com/
Resolving www.facebook.com (www.facebook.com)... 31.13.66.1, 2a03:2880:f013:1:face:b00c:0:1
Connecting to www.facebook.com (www.facebook.com)|31.13.66.1|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://www.facebook.com/unsupportedbrowser [following]
--2015-07-19 15:27:18-- https://www.facebook.com/unsupportedbrowser
Reusing existing connection to www.facebook.com:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’
index.html [ <=> ] 29.21K --.-KB/s in 0.04s
2015-07-19 15:27:18 (775 KB/s) - ‘index.html’ saved [29916]
$
完全修飾URLがない場合は、タグなどを含むメインページがダウンロードされますindex.html
。ブラウザで表示すると、このページでは私のブラウザがサポートされていないこと、つまりを通じてサポートされていないというメッセージのみが表示されますwget
。
$ eix wget
[I] net-misc/wget
Available versions: 1.16 ~1.16.1 ~1.16.2 ~1.16.3 {debug gnutls idn ipv6 nls ntlm pcre +ssl static test uuid zlib}
Installed versions: 1.16(11:25:57 AM 07/19/2015)(idn ipv6 nls pcre ssl zlib -debug -gnutls -ntlm -static -test -uuid)
Homepage: http://www.gnu.org/software/wget/
Description: Network utility to retrieve files from the WWW
コメントごと
Gentooベースの出力を見たことがない場合は、バージョン出力は次のようになります(注-DHAVE_LIBSSL
):
$ wget -V
wget -V
GNU Wget 1.16 built on linux-gnu.
+digest +https +ipv6 +iri +large-file +nls -ntlm +opie -psl +ssl/openssl
Wgetrc:
/etc/wgetrc (system)
Locale:
/usr/share/locale
Compile:
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H
-DSYSTEM_WGETRC="/etc/wgetrc" -DLOCALEDIR="/usr/share/locale" -I.
-I../lib -I../lib -DHAVE_LIBSSL -march=amdfam10 -O2 -pipe
Link:
x86_64-pc-linux-gnu-gcc -DHAVE_LIBSSL -march=amdfam10 -O2 -pipe
-Wl,-O1 -Wl,--as-needed -lpcre -lssl -lcrypto -lz -lidn ftp-opie.o
openssl.o ../lib/libgnu.a
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Originally written by Hrvoje Niksic <[email protected]>.
Please send bug reports and questions to <[email protected]>.
sslには、Gentooベースの出力のインストール済みバージョン行にマイナス記号が含まれていないことに注意してください。これは私のGentooシステムでSSLサポートをコンパイルしたことを意味します。さらに進むには、ディストリビューションで質問を更新してください。
答え2
vmWare ESXiまたは他のBusyBox環境でこのエラーが発生した場合、実際には以下を使用していませんwget
。
wget -V
私のための出力:
wget: invalid option -- 'V'
BusyBox v1.22.1 (2018-07-23 19:34:44 PDT) multi-call binary.
Usage: wget [-csq] [-O FILE] [-Y on/off] [-P DIR] [-U AGENT] URL...
Retrieve files via HTTP or FTP
-s Spider mode - only check file existence
-c Continue retrieval of aborted transfer
-q Quiet
-P DIR Save to DIR (default .)
-O FILE Save to FILE ('-' for stdout)
-U STR Use STR for User-Agent header
-Y Use proxy ('on' or 'off')
だからあなたは運がありません。 SCPなど、さまざまな方法でワークステーションからファイルを転送します。
答え3
「s」を削除してみてください。ちょうどhttpを使用することを意味します。
ほとんどの場合、httpからhttpsアクティブへのリダイレクトがあり、wgetがこれを介して機能しているようです。
通常のhttpを使用してブラウザにアドレスを入力してください。 httpsにリダイレクトすると、wgetが機能する可能性があります。
だから..wget http://example.com/file