zoukankan      html  css  js  c++  java
  • Install wget in Mac OS X Without Homebrew or MacPorts

     

    May 22, 2012 - 31 Comments

    The command line tool wget lets you retrieve a group of files from FTP and HTTP protocols, it’s a very useful utility for web developers and powerusers to have around because it lets you do things like perform quick and dirty site backups and even mirror websites locally.

    This approach is going to build and install wget in OS X from source, this means you’ll need Xcode and the Unix dev tools (free @ Mac App Store) installed, but it has the benefit of eliminating the need of a package manager like Homebrew or MacPorts.

     

    For those who don’t have the Command Line Tools package from Xcode installed yet, it’s fairly simple: Open XCode, then go “Preferences” and to the downloads section, and choose “Install Command Line Tools”, or you can get it from the Apple Developer Site as described here. Because the package has to download from Apple, it may take a while depending on your internet connection. Command Line Tools installs a C compiler, GCC, and many other helpful utilities that are commonly used in the unix world.

    How to Install wget in OS X

    Moving ahead and assuming you have Xcode and the command line tools installed, launch Terminal and enter the following commands as shown.

    First, use curl to download the latest wget source:
    curl -O http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz

    (sidenote: a new version of wget is available as 1.15, but 1.13.4 has been confirmed compatible. You can pick whichever one you want from the http://ftp.gnu.org/gnu/wget/ directory if you want a different version)

    Next we use tar to uncompress the files you just downloaded:
    tar -xzf wget-1.13.4.tar.gz

    Use cd to change to the directory:
    cd wget-1.13.4

    Configure with the appropriate –with-ssl flag to prevent a “GNUTLS not available” error:
    ./configure --with-ssl=openssl

    Build the source:
    make

    Install wget, it ends up in /usr/local/bin/:
    sudo make install

    Confirm everything worked by running wget:
    wget --help

    Clean up by removing wget source files when finished:
    cd .. && rm -rf wget*

    You’re all set, enjoy wget in Mac OS X.

     
     
  • 相关阅读:
    HDU 4489 The King’s Ups and Downs (DP+数学计数)
    HDU 2084 数塔 (水DP)
    CodeForces 706C Hard problem (水DP)
    CodeForces 706B Interesting drink (二分查找)
    CodeForces 706A Beru-taxi (数学计算,水题)
    HDU 4438 Hunters (数学,概率计算)
    机器学习-基础知识
    如何学习-学习理论(A-1)-KOLB学习周期理论
    如何学习-辅助工具
    如何学习-入门之后
  • 原文地址:https://www.cnblogs.com/reynold-lei/p/3587497.html
Copyright © 2011-2022 走看看