Edward E. Whitacre Jr., who took over in December, will replaced by Daniel F. Akerson, a GM board member. Analysts say the firm's second consecutive quarterly gain is a positive step toward an expected initial public stock offering. General Motors Co. posted a second-quarter profit of $1.3 billion Thursday and announced the retirement of Edward E.