Downloading big files that take a long time to arrive, such as new Ubuntu installation ISO images, can be fraught with difficulties. You'll need to have a perfect connection for the duration of the download (not always possible with wifi), and the remote server may sometimes drop the connection. Restarting from scratch to download a 670MB file when 669MB of it has arrived fine can be a very frustrating experience!
The solution is wget, Ubuntu's built-in command-line download manager. It runs at the command-line and all you need do is specify the complete path to the download file, including the http:// or ftp:// components, as applicable. For example, at the time of writing, the Ubuntu 8.04.1 release can be found at http://releases.ubuntu.com/hardy/ubuntu-8. 04.1-desktop-i386.iso, so to download this I would type the following into a terminal window:
$ wget http://releases.ubuntu.com/hardy/ubuntu-8.04.1-desktop-i 386.i so
As the download progresses, you'll see a percentage figure progress display, along with figures showing how much has been downloaded and the speed of the transfer. If wget loses the connection for any reason, it'll automatically try again, and attempt to resume where it left off. If you want to quit the download, type (Ctrl]+[c]. Don't forget to clear-up the partially-downloaded file.
Because large downloads can take a long time, you might want to use nohup with wget, to avoid wget quitting when the terminal window that started it is closed. This will effectively invisibly download the file in the background, and will persist even if you log out (to stop the download if needed, type killall wget into a terminal window/virtual console). See Tip 300, on page 350 for more information. Alternatively, you might consider using screen to start the wget download in a background terminal instance that you can switch in and out of in order to check progress—see Tip 207, on page 241 for more info.
You might also be interested in kget, which can be installed using Synaptic (search for the kget package; don't install the KDE4 version), and provides a GUI front-end to wget. It's officially a component of the KDE desktop, and is designed to work with the Konqueror web browser, but works fine under the GNOME desktop and Firefox of Ubuntu. Once installed, you'll find it on the Internet menu. You can drag and drop download links to its program window to start them downloading, or click Settings ^ Show Drop Target, for a small window onto which you can drag and drop the download links, like with some Windows download managers. (Tip: Right-click the floating window's minimize/maximize buttons and select Always On Top; this will stop it falling behind other program windows.)
Was this article helpful?