Anomaly, fluxes and (2,0) heterotic-string compactifications