‘wget -c’ Bug in Download Script Generated by Synaptic in Ubuntu 7.10(Feisty Fawn)
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:
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:
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/' $1Then 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++:-
out <<"wget -c" <<uris[i] <<endl;
should be:
C++:-
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.
"Ubuntu Edgy Eft was the first version to introduce this feature to Ubuntu users:"
QuoteNo. Dapper Drake has got this feature, too.
Comment by Anonymus — July 2, 2007 @ 3:14 am