How to Build and Install GNU wget on Apple OS X 10.5 Leopard


/ Published in: Bash
Save to your folder(s)

**Download**\r\n\r\n1. Download the latest source code from the [GNU wget website](http://www.gnu.org/software/wget/ \"GNU wget website\"). You can download the latest version from [this link](http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz \"Latest wget version\").\r\n\r\n2. Extract the downloaded archive to a directory of your choice. For this example, we will extract to a directory on the desktop.\r\n\r\n**Configure**\r\n\r\n1. Once extracted, open up the terminal, and `cd` into the directory where you extracted the wget source code. Adjust the example below accordingly.\r\n\r\n `cd /Users/admin/Desktop/wget-1.11.4/`\r\n\r\n2. Before compiling, we must configure the source code for our system by running the configure script that is included with the source code. The configure script lets us specify options on how we want to build the program.\r\n\r\n For example, we can control where to install the program. By default, wget will install into `/usr/local/bin`. If we wish to change the install location, we can run the configure script with the `--prefix=/path/to/install/location` flag.\r\n\r\n In the example below, we will install all the wget files in its own directory (/usr/local/wget).\r\n\r\n **If you want to install wget into the default location (`/usr/local/bin`), *omit* the `--prefix=/usr/local/wget` when running the command below.**\r\n\r\n `./configure --prefix=/usr/local/wget`\r\n\r\n**Compiling and Installing**\r\n\r\n1. Once the configure script is done, type in `make` to start building the wget binaries. It will take several seconds to compile wget depending on the speed of your system. Once the compilation is complete, install the binaries (as root) by typing in `sudo make install`.\r\n\r\n `make`\r\n \r\n `sudo make install`\r\n\r\n2. If you used the default installation path, restart your terminal session and type in `wget` to run the program.\r\n\r\n\r\n3. If you used the location in our example, you must use the full path to the binary:\r\n\r\n `/usr/local/wget/bin/wget http://www.example.com`\r\n\r\n * To use `wget` instead of the full path, you can add wget to your `.profile` path, or add it system-wide by editing `/etc/paths`.\r\n\r\n `sudo nano /etc/paths`\r\n\r\n * Add `/usr/local/wget/bin` to the end of the file as shown. When done, press CTRL+X, answer \"y\" to save the changes, and press RETURN to update the file. Restart your terminal session to reload the paths.\r\n\r\n `/usr/bin`\r\n \r\n `/bin`\r\n \r\n `/usr/sbin`\r\n \r\n `/sbin`\r\n \r\n `/usr/local/bin`\r\n \r\n `/usr/local/wget/bin`


Copy this code and paste it in your HTML
  1. cd /Users/admin/Desktop/wget-1.11.4/
  2.  
  3. ./configure
  4.  
  5. make
  6.  
  7. sudo make install

URL: http://www.unibia.com/unibianet/os-x/build-and-install-gnu-wget

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.