Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to set up an apt-mirror service for an offline repository but I've hit a weird error. I edited my mirror.list file to contain the proper paths (a USB drive mounted at /media/Ubuntu) but when I try to run apt-mirror, I get the following:

$ sudo apt-mirror /etc/apt/mirror.list
Argument "M-BM- " isn't numeric in numeric lt (<) at /usr/bin/apt-mirror line 204.
Downloading 982 index files using   threads...
Illegal division by zero at /usr/bin/apt-mirror line 209.

Any ideas as to what this could mean?

share|improve this question

closed as off-topic by Eliah Kagan, txwikinger, minerz029, karel, Eric Carvalho Jan 18 at 0:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Bug reports and problems specific to development version of Ubuntu should be reported on Launchpad so that developers can see, track and fix these issues." – Eliah Kagan, txwikinger, minerz029, karel, Eric Carvalho
If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Though this has been answered beautifully, it is still a bug for apt-mirror to crash with a division by zero error when a configuration file is malformed. I highly recommend reporting this as a bug; Gilles' analysis should help and the information from it can be included in the bug report to assist triagers and developers. –  Eliah Kagan Jan 17 at 8:18

1 Answer 1

up vote 9 down vote accepted

I'm looking at my crystal ball… It's a bit hazy… Ah, there it is.

You have an unbreakable space after nthreads in your mirror.list file. Replace it by a normal space.

Explanation: line 204 in the script is where apt-mirror compares the number of URLS — which is always numeric — with the value of the nthreads configuration setting. The parser for configuration settings doesn't check for numeric values, so a non-numeric value isn't detected until the setting is used. M-BM- displays two unprintable bytes c2a0 (0x42=B and 0x20=space, with M- indicating +0x80); this two-byte sequence encodes the unbreakable space in UTF-8.

In the future, post the full content of your configuration file when you ask such questions.

share|improve this answer
4  
This deserves many upvotes. It's a very neat explanation, shows what's going on and is therefore very interesting out of a simple cause for an issue! –  gertvdijk Jan 15 '13 at 21:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.