Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(‘The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

June 17, 2007

‘wget -c’ Bug in Download Script Generated by Synaptic in Ubuntu 7.10(Feisty Fawn)

Filed under: GNU/Linux — tabrez @ 10:15 pm

Update: This bug(bug #107925 at launchpad.net) has been fixed in the source code and the changes should make it to the next binary release of Synaptic Package Manager. (A deb package has since been built and made available on the launchpad website as synaptic 0.60ubuntu4 but I haven't tested it yet. It should make to the Gutsy Gibbon final release, and will also be back-ported to Feisty in all certainty.)

Ubuntu Edgy Eft was the first version to introduce this feature to Ubuntu users: Those who can't download large packages on, say, a home machine can just mark the packages to be installed in Synaptic Package Manager and then let it generate a download script. This script can be carried to a machine with good Internet connection and executed there to download all the required files. The download files can then be carried back to the home machine to complete the installation of selected packages through Synaptic Package Manager. I have explained the complete procedure in an earlier post:
Simple Way to Update Ubuntu Edgy With Slow/No Internet Connection

The download script generated by Synaptic Package Manager in Edgy contained simple wget commands, one for each file needed to be downloaded. Here is one example:

wget http://archive.ubuntu.com/ubuntu/pool/main/c/cvs/cvs_1.12.13-5build1_i386.deb

Elias brought to my notice in a comment post that Synaptic Package Manager in Feisty generates a slightly different command in the download script than in Edgy:

wget -chttp://archive.ubuntu.com/ubuntu/pool/main/c/cvs/cvs_1.12.13-5build1_i386.deb

The '-c' option added to the command continues/resumes partially downloaded package files if the download was interrupted earlier. There is a bug in the generated command i.e. lack of space between the '-c' option and the download URL. It is a confirmed bug #107925 on bugs.launchpad.net(filed way back in April).

Here are some of the ways to fix it:

  • Add a space manually after '-c' option in each wget command in the download script.
    wget -c http://archive.ubuntu.com/ubuntu/pool/main/c/cvs/cvs_1.12.13-5build1_i386.deb

    Tedious if the script has hundreds of wget commands in it.

  • Write a script to parse the download script and automatically add a space in every command. One such script is available from the bug page on launchpad: fix-download-script
    Or save the following text in a file(say 'fix.sh'):

    #!/bin/sh
    sed -i 's/-chttp/-c http/' $1

    Then run it like this:

    # sh fix.sh buggy-download-script
  • Patch the buggy source file and rebuild the packages. Not for the typical users! Here is a diff file from the same launchpad page: synaptic.debdiff
    It's a simple edit of synaptic-0.57.11.1ubuntu/gtk/rgmainwindow.cc file.
    This line:

    C++:
    1. out <<"wget -c" <<uris[i] <<endl;

    should be:

    C++:
    1. out <<"wget -c " <<uris[i] <<endl;

  • Wait for the patch to be applied by Ubuntu developers/volunteers and then apply the updates in your Ubuntu to fix the bug. The importance of the bug is set to 'medium' so it may take some time to get fixed. (The source code is fixed now; the next released binary of SPM application should have these changes in it.)

This bug was reported on April 20, 2007 and it is such a trivial fix, I totally fail to understand what is stopping anyone from applying this fix. I will update this post if it ever gets fixed.


If you want to receive future posts by email, enter your email address here:

Related Posts:

  • Simple Way to Update Ubuntu Edgy With Slow/No Internet Connection
  • Update or Install Applications on a Gentoo Machine Without an Internet Connection
  • Installing Complete LAMP Stack on Ubuntu 6.10(Edgy Eft)
  • Update or Install Applications on Debian/Ubuntu Without an Internet Connection
  • “Hello, World” Web Application in Ruby on Rails using console
  • Setting Up Development Environment For Grails on GNU/Linux
  • Installing Grails in Ubuntu GNU/Linux Using Package Manager


  • 1 Comment »

    1. "Ubuntu Edgy Eft was the first version to introduce this feature to Ubuntu users:"
      No. Dapper Drake has got this feature, too.

      Quote

      Comment by Anonymus — July 2, 2007 @ 3:14 am

    RSS feed for comments on this post. TrackBack URI

    Leave a comment


    Copyright (c) 2006, 2007 Tabrez Iqbal.
    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


    Powered by WordPress
    This website is hosted by Dreamhost