Tanzanian and Uganda exile forces spent their first day of occupation of Kampala today trying to deal with small pockets of resistance and a local population celebrating by engaging in a wild spree of looting.

Small groups of Ugandan soldiers have been routed out of buildings and houses where they were either hiding or sniping at passing Tanzanian troops. Other soldiers, some driving in civilian cars, have been captured or killed apparently trying to flee the city. By early evening, there were still frequent automatic weapons fire and occasional artillery blasts in the city center.

While easily winning the military battle. Tanzanian and Ugandan exile forces are fighting a losing battle against looters.

From dawn, thousands of Ugandans poured into the city and amid much enthusiasm smashed shop and office windows and carted away every movable object.

Even new cars were pushed through showroom windows, loaded with stolen goods and pushed out of town since the new owners had no keys.

In the hillside residential areas around the city, Ugandans have been breaking into empty houses and removing furniture, mattresses, clothes, lamps and televisions. Most of the houses broken into belong to Idi Amin's officials, who have deserted the city, but several homes of foreigners, inculding that of the French ambassador, have been looted.

One Tanzanian President Julius Nyerere "ordered us to do as little damage to the city as possible but now the local population is proceeding to wreck it."

Although some Tanzanian and anti-Amin Ugandan soldiers have veen stationed around town to discourage looting, military officials say they cannot effectively control the local population because of the army's preoccupation with eliminating Amin's remining soldiers.

Tuesday evening's march into Kampala was the Culmination of the Tanzanian Army's 180-mile trek from the Tanzanian border to the Ugandan capital.

I walked the final 14 miles with 800 soldiers of the 19th Division. This division, commanded by Col. Benjamin Msuya, has been the lead diviion of the Tanzanian Army throughout the six months war with Uganda. Its assignment today was to capture all strategic points in the city, including the radio station and Amin's command post.

After sleeping Monday night on a hilltop encampment, we began marching toward the capital at 5 a.m. The night sky was continually lit and the silence broken by artillery and mortar fire, most of it from Tanzanian forces.

Once we reached the main road to Kampala, we were joined by several other soliders who had been encamped in surrounding fields. In a heavy downpour we proceeded along the road led by three tanks and flanked on either side by soldiers cutting through the bush looking for Amin's forces.

We met no resistance, although we passed one Ugandan armored personnel carrier destroyed by Tanzanian artillery fire the previous night.

In the late afternoon as we reached the outskirts of Kampala, thousands of local residents gathered along the roadside waving and shouting, "Welcome, thank you," and "You are our brothers."

Several local residents reported that small numbers of Amin's soldiers had been in the area but had run away when the artillery fire came into their direction. Many houses had been hit by artillery. We passed one man lying by artillery. We passed one man lying dead in what was apparently the front door of his home.

By the time the tall buildings of Kampala became visible, the road was completely filled with jubilant people who hugged the soldiers and climbed on top of the tanks, decorating them with flowers.

The holiday spirit was suddenly broken on the edge of the city by a barage of small arms fire from Ugandan soldiers. The Tanzanians retaliated with heavy artillery and automatic fire. After 15 minutes, an estimated 10 Ugandan soldiers had been killed. CAPTION: Picutre, A soldier of the Tanzanian and Ugandan exile force guards ruins of a municipal council building in Kampala.UPI