If all the code in the upcoming release of the Debian GNU/Linux distribution were to be written today, it would cost $17 billion, according to an analysis by free and open source software consultant James Bromberger.

The equivalent would be $US19 billion, â‚¬14,4 billion, or £12.1 billions.

The Perth-based developer, who is a contributor to the Debian project, said he had used the SLOCCount program, created by well-known developer David A. Wheeler, to compute the figure, over two days.

The next Debian release, known as Wheezy, contains more than 17,000 pieces of software. Bromberger, who is also president of the Perth Linux User Group, said SLOCCount used a well-established model to calculate the time and effort required to design, implement and test each piece of software. The cost of writing the code was calculated using the average yearly salary of a developer which was put at $US72,533 using median 2011 estimates at salary.com and payscale.com.

"The analysis showed that the next release of Debian, codenamed Wheezy (due out later in 2012), contains some 419 million lines of source code written in 31 different programming languages," he said. "If it had to be created from scratch today, it would cost over $A17 billion to produce."

Bromberger said he had looked at the content from the "original" software that Debian distributes from its upstream authors without including the additional patches that Debian developers apply to this software, or the package management scripts (used to install, configure and uninstall packages).

"One might argue that these patches and configuration scripts are the added value of Debian. However, in my analysis I only examined the "pristine" upstream source code."

He said that clearly no company in its right mind would decide to undertake a project to write an entire distribution of this size - not even a subset of it.

"Whilst it's purely academic, it's nice to get a sense of the value of such a global volunteer effort as it approaches its 20th year of development. All these billions of dollars worth of software is available for anyone to use - for free, as much as they like, and to share with friends or make improvements if they wish!"

The value of code in some of the better-known packages, as computed by Bromberger are: Apache - $31 million ($US33.5 million), Samba - $93 million ($US101 million), MySQL - $59.7 million ($US64.2 million), Perl - $30 million ($US32.3 million), PHP - $31.1 million ($US33.5 million), and Bind - $13.8 million ($US14.8 million).

The Debian GNU/Linux project was begun in August 1993 by Ian Murdoch, a student at Purdue University, Indiana, at the time. More than a thousand volunteers contribute to the project which also the base for other distributions such as Ubuntu and Linux Mint.

"What sets Debian apart from many other distributions is that it is 100 per cent volunteer driven. Whilst various companies may sponsor some individuals to contribute, the entire Debian product is backed by a non-profit foundation called Software in the Public Interest," Bromberger said.

As far as programming languages went, Bromberger found that Debian contained 168,536,758 million lines of ANSI C code, 83,187,329 lines of C++ and 34,698,990 lines of Java.

Earlier studies on Debian 2.2 (codenamed Potato) estimated that it had 2800 packages containing 55 million lines of source code; the projected development cost was $US1.9 billion. A study of Debian 4.0 (Etch) found more than 10,000 source packages and 288 million lines of code.

The raw data for Bromberger's conclusions is available here.