Libya, preparing for elections in June, has banned parties based on religion, tribe or ethnicity, the government said on Wednesday,