The equals sign is for string conditionals, & the dash is for digit conditional comparison.
I think you misunderstood me.
Using bash, the bourne again shell, (and some other shells) you can use == instead of = without problem (though it gains you nothing), while using dash, the Debian Almquist shell, which /bin/sh points to on Debian and Ubuntu systems (as well as other debian-derived systems, I imagine), you can only use = and using == will cause the error which the OP encountered.
Numerical comparisons should be made using -eq etc. instead of = or == and don't figure into this at all.