首页 > 代码库 > 使用wget命令时发生错误

使用wget命令时发生错误

用的是centos6.5, 当我使用命今

sudo wget https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz

下载个cmake的包时, 发生了这样的错误

--2016-09-01 06:53:39--  https://cmake.org/files/v3.6/cmake-3.6.1.tar.gzResolving cmake.org... 66.194.253.19Connecting to cmake.org|66.194.253.19|:443... connected.ERROR: certificate common name “*.kitware.com” doesn’t match requested host name “cmake.org”.To connect to cmake.org insecurely, use ‘--no-check-certificate’.

没有检验证书, 应该是这样的意思吧. 可能是我这服务器的证书问题吧..

现在查看一下wget的帮助(wget option  URL):

GNU Wget 1.12, a non-interactive network retriever.Usage: wget [OPTION]... [URL]...Mandatory arguments to long options are mandatory for short options too.Startup:  -V,  --version           display the version of Wget and exit.  -h,  --help              print this help.  -b,  --background        go to background after startup.  -e,  --execute=COMMAND   execute a ‘.wgetrc’-style command.Logging and input file:  -o,  --output-file=FILE    log messages to FILE.  -a,  --append-output=FILE  append messages to FILE.  -d,  --debug               print lots of debugging information.  -q,  --quiet               quiet (no output).  -v,  --verbose             be verbose (this is the default).  -nv, --no-verbose          turn off verboseness, without being quiet.  -i,  --input-file=FILE     download URLs found in local or external FILE.  -F,  --force-html          treat input file as HTML.  -B,  --base=URL            resolves HTML input-file links (-i -F)                             relative to URL.Download:  -t,  --tries=NUMBER            set number of retries to NUMBER (0 unlimits).       --retry-connrefused       retry even if connection is refused.  -O,  --output-document=FILE    write documents to FILE.  -nc, --no-clobber              skip downloads that would download to                                 existing files.  -c,  --continue                resume getting a partially-downloaded file.       --progress=TYPE           select progress gauge type.  -N,  --timestamping            don’t re-retrieve files unless newer than                                 local.  -S,  --server-response         print server response.       --spider                  don’t download anything.  -T,  --timeout=SECONDS         set all timeout values to SECONDS.       --dns-timeout=SECS        set the DNS lookup timeout to SECS.       --connect-timeout=SECS    set the connect timeout to SECS.       --read-timeout=SECS       set the read timeout to SECS.  -w,  --wait=SECONDS            wait SECONDS between retrievals.       --waitretry=SECONDS       wait 1..SECONDS between retries of a retrieval.       --random-wait             wait from 0...2*WAIT secs between retrievals.       --no-proxy                explicitly turn off proxy.  -Q,  --quota=NUMBER            set retrieval quota to NUMBER.       --bind-address=ADDRESS    bind to ADDRESS (hostname or IP) on local host.       --limit-rate=RATE         limit download rate to RATE.       --no-dns-cache            disable caching DNS lookups.       --restrict-file-names=OS  restrict chars in file names to ones OS allows.       --ignore-case             ignore case when matching files/directories.  -4,  --inet4-only              connect only to IPv4 addresses.  -6,  --inet6-only              connect only to IPv6 addresses.       --prefer-family=FAMILY    connect first to addresses of specified family,                                 one of IPv6, IPv4, or none.       --user=USER               set both ftp and http user to USER.       --password=PASS           set both ftp and http password to PASS.       --ask-password            prompt for passwords.       --no-iri                  turn off IRI support.       --local-encoding=ENC      use ENC as the local encoding for IRIs.       --remote-encoding=ENC     use ENC as the default remote encoding.Directories:  -nd, --no-directories           don’t create directories.  -x,  --force-directories        force creation of directories.  -nH, --no-host-directories      don’t create host directories.       --protocol-directories     use protocol name in directories.  -P,  --directory-prefix=PREFIX  save files to PREFIX/...       --cut-dirs=NUMBER          ignore NUMBER remote directory components.HTTP options:       --http-user=USER        set http user to USER.       --http-password=PASS    set http password to PASS.       --no-cache              disallow server-cached data.       --default-page=NAME     Change the default page name (normally                               this is ‘index.html’.).  -E,  --adjust-extension      save HTML/CSS documents with proper extensions.       --ignore-length         ignore ‘Content-Length’ header field.       --header=STRING         insert STRING among the headers.       --max-redirect          maximum redirections allowed per page.       --proxy-user=USER       set USER as proxy username.       --proxy-password=PASS   set PASS as proxy password.       --referer=URL           include ‘Referer: URL’ header in HTTP request.       --save-headers          save the HTTP headers to file.  -U,  --user-agent=AGENT      identify as AGENT instead of Wget/VERSION.       --no-http-keep-alive    disable HTTP keep-alive (persistent connections).       --no-cookies            don’t use cookies.       --load-cookies=FILE     load cookies from FILE before session.       --save-cookies=FILE     save cookies to FILE after session.       --keep-session-cookies  load and save session (non-permanent) cookies.       --post-data=http://www.mamicode.com/STRING      use the POST method; send STRING as the data.>

然后我就可以用

sudo wget --no-check-certificate https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz

然后就ok了...很简单的一个操作

使用wget命令时发生错误