More than 500 illegal migrants who had hoped to set off at dawn on Thursday for a new life in Europe were arrested in the Libyan capital, officials said.