The Arab uprisings are making the old democracies of the west look more than ridiculous. Watching our behaviour from Cairo, I realised we deserve all the embarrassment that comes our way. For we will not grasp that, after 60 years of supporting and supplying the dictators we held to be guardians of stability, there is little we can sensibly offer in the way of advice or example to the Arab people.

We were so out of the loop on what was really going on in Arab societies that no analyst, journalist, diplomat or spy managed to predict the pressure that was building. Now that the eruption has taken place, we blunder in with our prescriptions on democracy, only mildly discomfited by the amount of our hardware that has facilitated the long history of oppression.

In Libya you will find teargas made in Britain and, according to Paul Rogers, of the department of peace studies at Bradford University (writing for the openDemocracy site), Mirage F-1 planes, recently upgraded by the French, who are foremost in calling for a no-fly zone, and C-130H Hercules transport planes from the US, where intervention has a growing number of advocates.

Indeed, until Congress objected on grounds of Muammar Gaddafi's human rights abuses, the Americans were about to deliver 50 refurbished M113 troop carriers, an order, incidentally, that was pursued by Gaddafi's odious son, Saif, as he was organising payments to the LSE.

Oddly enough, I am reminded of an exchange my wife once witnessed between Francis Bacon and the columnist Jeffrey Bernard in a Soho restaurant. Bacon asked Bernard whom in the world he would most like to bed. Bernard said Cyd Charisse and Monica Vitti, then asked the great painter about his ultimate fantasy.

"I'd like to get into bed with Colonel Gaddafi," replied Bacon after some thought. It turns out that all these governments and the previously revered LSE have a lot in common with Francis Bacon.

To say we are compromised by this behaviour hardly does justice to our position. What is most evident when you talk both to veteran dissidents and young internet activists in Cairo is that this revolution is not somehow in favour of the west, nor even in its imitation: it is a reaction to the appalling abuse and corruption that Egypt and Tunisia have suffered for two generations.

The Egyptian uprising is explained by two Cairo academics I talked to last week in the context of colonial history. First came liberation from the British; now comes liberation from the west's placeman, and indeed from the limiting western views of what is possible in Arab society.

The historian Niall Ferguson wrote a piece in the London Evening Standard, suggesting that democracy would not work in the Arab world because its societies had not "downloaded the apps" for secure property rights and the work ethic. He may have a point about the need for establishing property rights in law, but his brisk Protestant diagnosis fell short of understanding what life is like for the vast numbers of young men and women in Egypt, where 60% of the population are under 30.

It is not that they don't want to work: there are very few jobs, even for the most highly qualified. The same demographics and unemployment figures are true in Tunisia, where the revolution made considerable gains with the promise of elections in July for an assembly to debate a new constitution and, crucially, the scrapping of the hated directorate of state security.

The point is that the uprising was fired by demand for jobs as well as for a free press, free assembly, a parliamentary democracy and freedom from arbitrary punishment, torture and corruption, the noble ideals that resulted in democracy in England and America.

You may argue that these are in imitation of the west, but actually they are expressions of what Tunisians, and for that matter Egyptians, believe is the only way to address the problems of their societies. They aren't applications downloaded from the west but solutions produced more or less independently in the minds of Arabs.

The revolution in Egypt has a lot more to achieve than in Tunisia, which has about an eighth of Egypt's population of 80 million and none of its religious tensions. Things are still moderately hopeful, even though the 2,000 Coptic Christians I saw demonstrating outside the state TV building were attacked by Muslims, probably in a planned attempt to sow discord among protesters of different religions, who had stood together in Tahrir Square two weeks before.

Egyptians understand that a dark energy is at work, which almost certainly emanates from the army generals, who allowed the shooting of 13 people during the disturbances last week and, as Human Rights Watch established, have taken over the role of chief torturer from state security.

The army played a subtle game during the uprising and is seen by most as the saviour of the nation, even though it is vastly corrupt and is believed to run something between 15% and 30% of the Egyptian economy, a network of businesses that extends from hotels to manufacturing and service industries. The army will not easily be put in its place and deprived of ultimate power, but a legitimately elected president, possibly the shrewd head of the Arab League, Amr Moussa, may go some way to create the checks and balances needed in a free society.

Elections will happen, though too quickly to allow proper organisation and debate, and the state security appears to have merged into the background, for the time being.

To witness in Tahrir Square the open political discussions around posters of the hated figures of the Mubarak regime, and to hear activists of all ages and religions reel off their democratic demands like a religious litany, was very moving. Egyptians have a long way to go, especially on women's rights, but one thing is certain: they are not going back.