Mark Shuttleworth has lost his long-running fight to reverse a US$20m (£12.8m) bank charge levied after he transferred a fortune out of South Africa.

In 2001, Shuttleworth, the founder of Ubuntu Linux maker Canonical, emigrated from his home nation of South Africa to the Isle of Man. In 2008, he tried to withdraw R2.5bn (US$204m, £128m) from his account in the South African Reserve Bank. The bank, under orders from the SA finance minister, withheld 10 per cent of the transfer as an exit charge.

Shuttleworth was furious, and took the bank to a High Court in Pretoria to claim back his millions, basically calling the whole thing unconstitutional. The court said the exit charge was legit, but decided some of the currency exchange rules surrounding the fee were unlawful and unconstitutional. Shuttleworth took the matter higher to the Supreme Court of Appeal, which said the rules were valid, but the bank charge was not. The SA government and reserve bank also launched a cross-appeal. What a mess.

The Linux entrepreneur's case finally ended up before the South Africa Constitutional Court, which on Thursday this week ruled [PDF] that the South African Reserve Bank was right all along to withhold the wedge.

"The exit charge was not inconsistent with the Constitution. The dominant purpose of the exit charge was not to raise revenue but rather to regulate conduct by discouraging the export of capital to protect the domestic economy," wrote Judge Dikgang Moseneke.

Shuttleworth made his fortune when he sold his certification company Thawte Consulting to VeriSign for US$575m. He went on to found Canonical, stepping down from the CEO role in 2009.

The US$20m tax bill would roughly equal what the Ubuntu boss paid for a trip aboard the Russian Soyuz space capsule, and an eight-day stay aboard the International Space Station in 2002. In 2010 he splashed $34m on a New York condo.

Thanks to the court's ruling, Shuttleworth will not be able to reclaim the funds the bank extracted from his account. Shuttleworth's reps did not respond to a request for comment on the judgment. ®