Tell me more ×
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

1 Answer

up vote 4 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
1  
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 at 21:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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