Continued from page 1

Under the law passed in December and in the detailed process laid out this year by the Pentagon, the military chiefs must report to Mr. Gates every two weeks on training progress and eventually need to make a recommendation on whether the repeal will damage the military’s ability to fight.

If Mr. Gates approves the certification before he leaves office, the repeal could be implemented fully in September.

The most common question that has arisen during the troops’ training, Mr. Gates said, has been on military housing. He said commanders are developing ways to deal with that.

Mr. Gates also sounded a cautiously optimistic note about developments in Yemen, where the government and opposition tribes have engaged in armed clashes, pushing the country toward civil war. He said things have calmed down a bit since President Ali Abdullah Saleh left for neighboring Saudi Arabia on June 5 for medical treatment of wounds he suffered in an attack on his compound in Yemen.

“I don’t think you’ll see a full-blown war there,” Mr. Gates said. “With Saleh being in Saudi Arabia, maybe something can be worked out to bring this to a close” by finding an accommodation among Mr. Saleh’s family, the opposition tribes and the military.

Mr. Gates, who originally opposed U.S. military intervention in Libya, predicted that strongman Col. Moammar Gadhafi will fall — “whether it’s of his own volition or somebody takes care of it for him.” By that he meant either the military or his own family could turn against the longtime Libyan leader.

Reflecting on his imminent departure from a job he has described as the most rewarding in his long career of government service — including 27 years at the CIAMr. Gates said he is confident that Mr. Panetta will gain his footing quickly at the Pentagon.

“There is no lapse in terms of somebody getting up to speed on the issues,” Mr. Gates said. “Essentially, Leon just changes place in the Situation Room,” referring to the main crisis management room inside the White House.

“He’s been in all the conversations on all the big issues, so there’s just no catch-up time at all for him,” he added.

Mr. Gates, 67, who is retiring to his home in the Puget Sound area of Washington state, said without hesitation that he will miss just two things about his job.

“One is the people that I work with, and the other is the troops. I won’t miss anything else.”

AP writers Anne Gearan and Kimberley Dozier contributed to this report.