Andrew Kayiira, 1986 - At the time of the fall of the Tito Okello government, Uganda was led by two main guerrilla groups, the National Resistance Army (NRA) led by Museveni, and the Uganda Freedom Movement (UFM) led by the former deputy minister of Internal Affairs in 1979, Andrew Kayiira.
The NRA gained the upper hand starting in late 1985 when it became the main opposite number of the Military Junta of Okello during the Nairobi peace talks.
It was the NRA that finally fought the battles that swept Okello's government from power in January 1986.
The UFM was incorporated into the new national army, the NRA, with most UFM troops deployed in northern Uganda and Kayiira was named a Minister of Energy in the NRM's broad-based government.
By virtue of his heading the UFM's armed wing, the UFA, he was regarded as the most credible rival to Museveni in a post-1986 Uganda.
Kayiira was gunned down in March 1987, just two weeks after he had been freed from jail on a treason conviction.
Kayiira was the last person to be in a position to challenge Museveni both in terms of broad political appeal and, most importantly, in terms of having a large military force loyal to him and potentially one that could be mobilised at a short notice.
Herbert Itongwa, 1995
After Kayiira's death, Museveni continued to tighten his grip on power and much of the southern half of the country turned to economic recovery and an acceptance of a Museveni Uganda.
A number of armed groups, most of them made up of former Uganda Army or Uganda National Liberation Army officers and men, tried to challenge the Museveni regime but were defeated militarily.
Maj Herbert Itongwa, veteran of the NRA guerrilla war in Luweero, launched an armed rebellion in Buseruka in 1995 but that was quickly put down by government troops.
Itongwa's was the first armed uprising involving a leader from the NRA.
Paul Ssemogerere, 1996
Paul Ssemogerere in 1996 was the first to challenge Museveni in a presidential election.
Ssemogerere had been a personal assistant to the DP president Benedicto Kiwanuka in the 1960s and was the president-general of the DP and presidential candidate for the 1980 general election.
He finished second to the UPC's Milton Obote, the former president, in that election whose outcome is still debated and disputed to this day.
When the NRM came to power in 1986 it was militarily victorious but lacked a national appeal.
Museveni addressed this by announcing a government that allotted ministerial positions to leaders from the DP, UPC and the Conservative Party or CP.
Ssemogerere was named minister of Internal Affairs in 1986 and later minister of Foreign Affairs but resigned in 1995 after he grew dissatisfied with the direction Museveni was taking the country.
At that time although the NRM was becoming more and more established as a political force, the traditional parties DP and UPC still held sway across the country.
Buganda was still resentful over the failure of the Constituent Assembly to include federalism in the 1995 Constitution.
Much of northern Uganda was still in the grip of a 10-year armed rebellion against the NRM government.
However, because of the belief that Museveni was in a strong position, the DP and UPC agreed to put aside their decades-old rivalry and front a single presidential candidate, Ssemogerere, at the head of a coalition called the Inter-Political Forces Cooperation (IPFC).
Ssemogerere attracted large and passionate crowds everywhere he went.
Little is known about what actually happened with the results of the 1996 election. The assumption is that Museveni was still very popular and did win with the 75 per cent margin that was officially announced.
Future historians will uncover a different story. Suffice it to say, Ssemogerere tapped into a mass, mainstream tide.
David Tinyefuza, 1996
In the latter part of 1996, the former minister of State for Defence, Maj Gen David Tinyefuza (now Gen Sejusa), became disillusioned with the status quo.
He announced his wish to retire from the army, citing instances in which it was poorly managed as his reason.
A much-publicised court case soon gripped the country. The army refused to let Tinyefuza resign and Tinyefuza took the matter to court.
It seems to have occurred to President Museveni that Tinyefuza did not simply wish to retire from the army.
He wanted to be free of military law and obligations to embark on a political career, with a possible eye on the presidency at the next general election, and that Museveni was not going to allow.
After Tinyefuza lost the case, his fortunes, political and financial, quickly eroded and he faded from the public spotlight.
The fascination with Tinyefuza's court hearings suggested that the public either saw in him a possible presidential candidate or was simply looking for a force that could serve as a counterweight to Museveni.
Kizza Besigye, 2001
By the late 1990s, the belief was established that Museveni was in such a strong position that he could not be defeated by an ordinary politician.
He had to be taken on by someone from inside the NRM and, if possible, with Museveni's own military background, a kind of David Tinyefuza.
The former National Political Commissar and former personal doctor of Museveni, Dr Kiiza Besigye announced in a long statement published in the Sunday Monitor a list of grievances with the way the NRM was running the country.
He also announced he was resigning from the army and intended to seek the presidency in the 2001 general election.
For some reason, Besigye captured the public imagination in the way Tinyefuza had done, but much more so.
Many were suspicious of him at first, thinking he was as much a part of the NRM as Museveni and there was even a view that he might be a decoy deployed by Museveni.
His big moment came when the former mayor of Kampala, Nasser Sebaggala, who had recently been convicted over money laundering in the United States and a long-time DP member, threw his weight and supporters behind Besigye.
Sebaggala gave Besigye the legitimacy he needed in central Uganda (that was when Besigye took to writing his first name Kiiza as "Kizza" to appeal to Baganda and Basoga.)
Backed by his charismatic wife and political star in her own right, Winnie Byanyima, the 2000-2001 presidential campaign took on an excitement not seen in years.
The election ended with victory for Museveni, Besigye in exile in South Africa after he was tipped off that he was about to be arrested.
Besigye's campaign and wide appeal put Museveni under severe pressure, driving him to resort to negative tactics and personal attacks on Besigye and Byanyima.
From his exile home in South Africa, Besigye became a voice of protest, from opinion articles in national newspapers to occasional guest appearances by phone on Kampala political talk shows.
Besigye, unlike Ssemogerere and Tinyefuza, had the fortune of appearing on the campaign scene at just the right time and in the right circumstances.
He found the country disillusioned enough with Museveni to want change and became the de facto national Opposition leader.
In October 2005, Besigye returned from exile and announced his intention to seek the presidency in 2006. Immediately, hundreds of thousands of Ugandans flocked in record numbers to various national Electoral Commission offices to register as voters.
As it had been in 2001, campaign posters of Besigye in his army uniform were widely circulated in 2005. The cult of the military was by now firmly established in Uganda.
The public was convinced that the only person who could realistically challenge Museveni was a military man, not a civilian.
On his return, Besigye launched a nationwide meet-the-people tour and huge crowds welcomed him at every stop.
Alarmed, the government decided a stop had to be put to this and Besigye was arrested in November 2005 as he returned to Kampala.
Three days of serious rioting erupted across the country.
In the drama that followed, Besigye was brought to court for trial on treason, granted bail, re-arrested, all of which added to his image as a persecuted hero.
He finished second once again to Museveni in the 2006 election, which this time even to the justices of the Supreme Court, was notable for its irregularities.
From now on, Besigye would become the most important and most dominant Opposition figure in Uganda's post-independence history.
He run a third time for the presidency in 2011, although the third attempt lacked a little of the magic of the first two times.
In 2016, however, just when it seemed his best days were behind him, a new national wave of popularity came his way and this time, it was expressed by crowds all over the country spontaneously raising money and offering food and chicken to him on the campaign trail.
Amama Mbabazi, 2016
In the meantime, restlessness within the ruling NRM over Museveni's seemingly unending tenure in office led a long-time Museveni loyalist Amama Mbabazi to start a grassroots move to challenge Museveni for the party presidency.
He was sacked as prime minister in 2014 and dropped as NRM secretary-general in 2015, and announced a presidential bid that same year, running as an independent.
Mbabazi's bid created tensions both within the NRM where he was still nominally a member, and in the Opposition where a number of leading Opposition figures rallied behind him as Uganda's last best hope of removing Museveni from power.
Mbabazi, it was reasoned, had known Museveni since the early 1970s, was at the heart of the Fronasa-NRA establishment, had been part of previous NRM election rigging so knew "all the tricks".
To take on Museveni, some Opposition factions formed a coalition similar to the IPFC of 1996, which was called The Democratic Alliance or TDA.
Tensions now surfaced over who should be the TDA presidential candidate for 2016, Dr Besigye who had tried thrice before and failed to dislodge Museveni. Or Mbabazi who, in some opinions, had the money, ground organisation and clout to defeat Museveni.
Eventually the Opposition failed to agree on either man and decided that all should seek the presidency in their individual right.
TDA collapsed and Museveni went on, once again, to be declared the winner of the election.
Bobi Wine, 2021?
With this as our background, we examine a possible Bobi Wine presidential bid. He is, after all, already a self-styled "Ghetto President" and, given his newfound national appeal, could possibly be a candidate in 2021.
If he does seek that office, the track record of arrests, detention, exile and physical abuse by the security forces endured by Besigye should give Bobi Wine a taste of what is to come, since he has chosen street activism.
Mbabazi's decades-long experience in the Fronasa and NRA guerrilla groups and equally long service at the helm of Uganda's State security and defence establishment were not enough to give him a significant electoral showing.