Muammar Gaddafi observes a military parade in Tripoli last Tuesday marking the 40th anniversary of the 1969 military coup that brought him to power

Tripoli's makeover is really only one street deep. Behind the white-washed avenues and carnival lights lie the same jumbled streets where pedestrians vie for space with cars and street-hawkers.

All this under a warm, stale drizzle that falls from the city's relentless air conditioners.

In the absence of shopping malls, neighbourhoods are still defined by trade. On Kanady Street the business is car accessories and business is good. "For a Libyan, 70% of the money you spend on a car goes on buying the car," Khaled (25) explains." The rest is to pimp it up," he says with a smile, pleased with his up-to-the-minute English.

Libyans who can afford to buy one spend a lot of time in their cars, the engineering student explains. The Islamic People's Republic is a dry state and, in the absence of bars, clubs or cafés, cruising and listening to music is what passes for fun.

There's another reason though.

Thanks to price controls, petrol is cheap – as little as 11c a litre. That makes sense in a country sitting on top of some of the world's largest oil reserves. What it doesn't take into account is what some diplomats in Tripoli call the "dysfunctional economy".

Much of Libya's crude is transported to Italy to be refined and then re-imported into the home market. This leaves Libya paying more in petrol price subsidies than it spends on education and health combined.

Cheap fuel is a pacifier that the regime understands well and even creeping price rises of a cent or two over the last couple of years have drawn rare protests.

"It might seem cheap to you, but it's a question of perspective," says Khaled. With little else to show for its hydrocarbon wealth, Libyans expect affordable petrol. The son of a doctor, with two years to left to study in engineering and metallurgy, Khaled knows not everyone has it easy.

Khaled is part of an emerging Libya that can be hard to see behind the raucous pantomime which Col Muammar Gaddafi creates everywhere he goes. Less often discussed than his sponsorship of terrorists and guerrilla groups are the achievements of his 40-year-old revolution.

In the 1960s, fewer than one in five of King Idris Senoussi's subjects was literate. Today literacy rates stand at 83%. The first stretch of a North African highway was opened last week; and electricity, as the armies of air conditioners testify, is near-universal. Under the quixotic colonel, life expectancy hovers around 75, having risen from 44.

In the past six years, since the end of the international embargo, everything has changed. Khaled says. The cranes that sketch Tripoli's skyline are the first tangible signs that the capital may become the next petro-city, another Dubai or Doha.

But welfare paid for by oil wealth, matched with price controls that hold down the cost of living, have left Libya – like many of the oil states – with a huge and listless army of unemployed. Nearly 30% are jobless and as many as two million immigrants from south of the Sahara fill the void doing the menial jobs Libyans eschew. Senegalese, Gambians and Eritreans line the dusty roadside with their tools, waiting in the scorching heat for a day's work.

The paradoxes that confuse attempts to understand Libya meet you at the airport. Signs assure you that there are "Partners not Wage Workers" in Libya, a country that ministers later tell me is much "misunderstood" as it practises "direct democracy". However, the capital is dress­ed in a crude cult of personality that allows for no partners. There is only one face on any billboard in the entire city – that of Col Gaddafi.

Libya's people may be living longer, but the contradictions are clear in its ailing health sector. A late-night trawl through Tripoli's hospitals in search of the dying Abdelbaset Ali al-Megrahi, the Libyan agent blamed for the Lockerbie bombing, provides a good look behind the curtain.

Parts of the capital's sprawling central hospital are 250 years old, a surgeon explains. The quality of the equipment, hygiene and personnel vary wildly between its overcrowded wards.

"If people get really ill here they go to Tunisia," says the surgeon. "Only those who can't afford it stay here." Many of Libya's best doctors have left the country in frustration at under-investment and political interference.

Megrahi was eventually tracked down to the VIP ward of the Tripoli medical centre, where foreign doctors are rumoured to have been brought in to care for such a high-profile patient.