Presiden Idi Amin of Uganda has won an apparent reprieve thanks to the arrival of perhaps 2,000 Libyan troops reinforcements that reportedly have halted a major Tanzanian and Ugandan exile drive to capture his capital.

By all accounts, Libyan troops stepped in to replace the largely disintegrated Ugandan army. The Libyans now man key defenses inside Kampala and have driven the invaders back beyond artillery range, although they have been unable to prevent air attacks, such as that against Entebbe today.

Whether the reprieve in the now five-month-old war will amount to permanent salvation for Africa's most controversial strongman remains very much in doubt. But, if nothing else, Libyan leader Muammar Qaddafi's decision to back Amin to the hilt has place Tanzanian President Julius Nyerere in a most uncomfortable position, according to one analyst here.

Nyere has already alienated many African leaders who, whatever their personal distaste for Amin, are worried by the precedent of Tanzanian violation of another black African army is ready to commit troops to help his invading force now that the Libyans have jumped in with both feet.

About the only thing that is clear in a complicated and confused drama is that the confrontation is now solely between Tanzania and Libya.

It was Qaddafi's ultimatum a week ago to Nyerere to withdraw his troops that, when ignored, set in train the airlift of Libyan reinforcements at midweek.

"It is an open secret that the Libyans are doing the fightinh," a Kampala-based diplomat said in corroborating reports that Ugandan troops had disappeared as an effective fighting force and had been replaced by Libyans.

Whatever the Libyans' limitations as soldiers may be, their presence appears to be every bit as effective as that of the Moroccan expeditionary force that propped up President Mobutu Sese Seko's mineral-rich Shaba Province in Zaire in 1971.

Although the war may be far from over, analysts increasingly question Tanzania's snail's pace in roganizing its drive against Amin.

Only when Qaddafi proved he was not bluffing did Tanzania make a determined push on Kampala. But it appears to have been too late.

Nyerere's camp is not short on arguments to explain Tanzania's actions. They vary froma desire to let the Ugandan exiles organize militarily and politically to the desire to keep a low Tranzanian profile and difficulties with long lines of communications for a Third World army.

But basically this all smacks of excuse making.

War is an unforgiving enterprise in which speed and resolution often carry the day against seemingly impossible odds.

Whether Nyerere actually felt Qaddafi would make good his threat is not known. The Tanzanian leader may have been convinced that it was mere talk in light of the reports of mobilization on both sides of the Libyan and Egyption frontier that might have dissuaded Qaddafi from sending help to Amin.

A determining factor for Qaddafi apears to have been the desire not to lose face, allowing the overthrow of a longtime ally who, whatever his other characteristics, was a fellow Moslem.

Equally curious are Kenya's motives in apparently tilting toward Amin. Still at odds with Ranzania-the border remains closed-Kenya also remembers the days before Amin when Tanzania and Uganda regularly ganged up against it in the now-defunct East African Community.

Kenya has showed its hand recently in arresting anti-Amin Ugandan political exiles and in issuing a call for Tanzanian withdrawal from Uganda.

Kenya's embarrassment was under-lined today when after 48 hours, a police official issued a vague statement that did not entirely dismiss Ugandan exile assertions that Kenya was allowing 50 truckloads of Libyan arms to be unloaded from a freighter in Mombasa harbor.

Whether such help can save Amin in the long run is unknown.

But for the Ugandan leader who has survived a dozen assassination attempts and now an invasion which came close enough to destroy one of his Kampala residences, the very fact that he is alive and well-albeit at Libyan sufferance-is doubtless quite enough.