Iterative localization algorithms are critical part in the control of mobile autonomous robots because they feed fundamental position information to the robots. In a harsh unknown environment, the estimation of environmental noise is hardly obtained during the movement of the robots. It means that the state-of-the-art methods, which increase localization accuracy using error management, are unsuitable. In this paper, we deduced an upper bound of the localization error without knowing the precise model of environment noise when the anchor nodes have position errors. Utilizing the minimum upper bound, we can construct an optimal localization linear system of iterative localization algorithms based on least square. An algorithm of generating localization linear system is proposed by using the minimum upper bound. The algorithm reduces the impact of the shortage of environmental information on localization error propagation. Our simulation results show that the algorithm is insensitive to noise and can improve the localization accuracy by constructing a proper localization linear system with a high probability.