GNU/Linux 中到底有多 GNU ?

按照 Free Software Foundation 的说法,Linux 的全称应该是 GNU/Linux。那么一个常见的 Linux 发行版究竟有多 GNU 呢?

Pedro Côrte-Real 在他的博客中发表了一份以代码行为单位对于 Ubuntu 11.04 中 main 仓库包含软件 GNU 比例(仅限由 Ubuntu 打包的部分,不包括从 Debian 继承的)的分析,参见下图:

由图中可见红色部分的 GNU 软件仅占了 8%(指由 Free Software Foundation 起领导作用)。注意其中 GNOME 并未包含其中,因为 GNOME 有自己的基金会和管理团队。

从中可以发现:

  1. 内核的代码行和 GNU 软件代码行数量相当。
  2. 其他各类小型的项目贡献的代码行实际上占据了过半的比例。

针对其中的 8% 部分,Pedro Côrte-Real 又进行了更深的分析,见下图:

从中可以很明显的看出,glibc/gcc/binutils/gdb 的组合占据了 GNU 软件代码中的绝大部分。对于某些最终用户来讲,可以比较容易的找到这些组件的非 GNU 替代品,除了 gdb。

作者同时还公布了自己进行代码比较的程序源代码

消息来源:Pedro Côrte-Real 个人博客

Read More:

53 Comments

  1. 1 resty Commented @ 2011-06-06 21:59Reply to this comment

    用代码行数来比较软件的重要性......

  2. 2 qii Commented @ 2011-06-06 22:04Reply to this comment

    kde竟然有8%,好多…

  3. 3 fanhe Commented @ 2011-06-06 22:04Reply to this comment

    很多基础的东西都是gnu的, 而且这些都很重要, 如gcc, coreutils, binutils等等. 如果这些都有了非gnu的替代, 就真能去掉 gnu了.

  4. 4 osily Commented @ 2011-06-06 22:13Reply to this comment

    这么比没什么意义,gnu不可能什么软件都开发。而一个linux能运行起来只需要很少的包,而其中很多就是gnu的。GNU/linux是系统名称,和上边运行的软件有关系么。

  5. 5 kidfruit Commented @ 2011-06-06 22:13Reply to this comment

    gcc没那么容易拿掉……虽然gcc本身占的“代码行数”不多,但是other里面大多数软件都是基于gcc的……

  6. 6 palxex Commented @ 2011-06-06 22:27Reply to this comment

    linux kernel是跟GCC绑定的吧。ICC也能编译,因为它的linux版是特意跟gcc同步了ABI的。其他编译器编译linux kernel目前有完全100%编译通过的么?

  7. 7 Boild Commented @ 2011-06-06 22:28Reply to this comment

    mozilla和java……

  8. 8 依云 Commented @ 2011-06-06 22:30Reply to this comment

    @fanhe: FreeBSD 不是已经去掉 GNU 了吗?

  9. 9 reiase Commented @ 2011-06-06 22:37Reply to this comment

    认识一个做编译器的朋友,说编译器的圈子很小,其中非gcc的编译器也从gcc拿了东西用的。

    就个人用bsd和rix的经历来说,你一linux用户,离了gnu的bash,coreutils,gmake,vim,emacs,gcc,gdb……立马歇菜. 不过离了kde,gnome和mozilla,天还是一样亮。

    所以不要小看gnu那个百分之几

  10. 10 fanhe Commented @ 2011-06-06 22:44Reply to this comment

    @依云: kernel 为 gnu 特制, 而且现在的linux发行版的基础组件都是gnu的, 你当然也可以把freebsd那些非gnu基础组件全部搞到linux这边,但是你得先用非gcc编译个能用的内核再说.

  11. 11 fanhe Commented @ 2011-06-06 22:46Reply to this comment

    反正现在绝大多数linux发行版,真的就是 gnu/linux

  12. 12 fanhe Commented @ 2011-06-06 22:49Reply to this comment

    @reiase: vim不是gnu的

  13. 13 Zoom.Quiet Commented @ 2011-06-06 23:11Reply to this comment

    要是根据软件数量来比较的话,就不同了, 代码行数多,不代表软件能干..

  14. 14 依云 Commented @ 2011-06-07 0:12Reply to this comment

    @reiase: @fanhe: 嗯,GNU 已经弄了个 Emacs,肯定不会再弄个 vim 了。

  15. 15 acup Commented @ 2011-06-07 8:12Reply to this comment

    我居然没在这个比较里发现 bash。

  16. 16 acup Commented @ 2011-06-07 8:18Reply to this comment

    另外也不清楚他说的 kde 占 8% 是否包括 qt 的代码,要知道 qt 的代码就已经 200 多万行了,它不能算是 kde 贡献的代码,而应当是当初奇趣公司贡献的代码。

    另外搞过工程的人一般都知道,越是外围,代码越多。拿 gnu 贡献的代码去跟那些搞外围 app 的东西去比较,就好比是拿 cpu 去跟一大堆 usb 设备去比较。

  17. 17 acup Commented @ 2011-06-07 8:24Reply to this comment

    还有一点,linux 内核代码当初之所以被扔到了互联网上,是因为 linus 大神当初被 rms 教主给忽悠了。但是如果 rms 教主当初没有忽悠 linus 大神,现在大家连 linux 内核可能都没有,更谈不上 mozilla、gnome 之类的外围产品会面世了。

    我知道也许会有人针对我的这个评论抛出 bsd 之类的神马东西证明没有 linux 也会有很多开源软件出现,但是要搞明白 bsd 当初是被许多 unix 厂商围追堵截,没人愿意在它上面开源。

    gnu 对 foss 的贡献是最基本的贡献,就像阿姆斯特朗踏上月球的第一步那样。以后可能很多人都会跑到月球上踩脚印,但是那种行为跟小孩过家家没啥两样。

  18. 18 qii Commented @ 2011-06-07 8:58Reply to this comment

    ……原文压根没提到/比较重要性吧,只是纯粹比代码量而已,怎么这么多人不停的扯重要性。

  19. 19 damn Commented @ 2011-06-07 8:58Reply to this comment

    GNU自身有个叫hurd的微内核,但由于其“先进性”使其难于debug。既然这种先进造成开发如此缓慢,永远追不上linux,干脆别再浪费时间了,重新想一种容易调试又有微内核好处的架构吧……

  20. 20 stecue Commented @ 2011-06-07 9:13Reply to this comment

    不过在wikipedia和GNOME foundation网站的首页上都写着“GNOME is part of the GNU Project”,虽然GNOME基金会和FSF并不是上下级关系。以前记得确实有争论说GNOME要独立出GNU Project,看来最后就保持现状了吧。

  21. 21 acup Commented @ 2011-06-07 9:16Reply to this comment

    @qii: 如果不谈重要性的话,那么这个比较就显得太无聊了。谁想看代码量,直接用 cloc 这个工具去看就是了。

  22. 22 acup Commented @ 2011-06-07 9:19Reply to this comment

    我从“按照 Free Software Foundation 的说法,Linux 的全称应该是 GNU/Linux。那么一个常见的 Linux 发行版究竟有多 GNU 呢?”这句话里,怎么也看不出作者的本意就是想纯粹的比较一下代码量。

  23. 23 qii Commented @ 2011-06-07 9:35Reply to this comment

    @acup: 重要性不都是越下面的越重要……有啥好蛋疼的比的。

  24. 24 test Commented @ 2011-06-07 10:10Reply to this comment

    呃,对于某个桌面的某个用户而言,下面的东西当然不重要,因为对于他,只有图标啊、主题啊神马的才是最重要的。

  25. 25 fanhe Commented @ 2011-06-07 10:25Reply to this comment

    @test: 那是他感受不出来而已,当失去了才感受得出来.没了下面的东西就是一个黑屏,图标啊主题啊都变成了浮云.

  26. 26 PWD Commented @ 2011-06-07 10:27Reply to this comment

    编译器,c库,内核, 最重要。不管代码多少也得叫做 GNU/Linux

  27. 27 csslayer Commented @ 2011-06-07 10:40Reply to this comment

    @acup: 其实作者只是好奇想看看按FSF的说法Linux应该叫GNU/Linux,里面GNU在代码上到底占了多大比重而已。兴许哪天就会出现一个蛋疼的人搞了个去GNU的发行版,像FreeBSD那样……(话说回来去掉gettext怎么国际化……gettext早就成事实标准了……去掉了谁和你玩阿,不光是gdb吧)

    但谁也没否认FSF在开源上做的贡献。

    大家淡定啦……

  28. 28 qii Commented @ 2011-06-07 10:51Reply to this comment

    @qii: 貌似我这句话有点歧义了,我的意思是“重要性不都是越下面的越重要吗?……有啥好蛋疼的比的。”不过从后半句应该也能推出我前半句是肯定底层东西的重要性。

  29. 29 qii Commented @ 2011-06-07 11:00Reply to this comment

    45度角望天,这是怎么了(叹气),我闪避都堆上了99%都能中枪。

  30. 30 T2 Commented @ 2011-06-07 11:10Reply to this comment

    clang前一段不是说编译出了能用的内核? 有些人是不是该考虑自重一下了…

  31. 31 bcbc Commented @ 2011-06-07 11:14Reply to this comment

    @T2: clang可以编译FreeBSD内核,但是需要最新的9.0。部分ports也可以正常编译运行。

  32. 32 bcbc Commented @ 2011-06-07 11:18Reply to this comment

    llvm/clang若顺利走下去,应该可以和GPLv3的gcc(>4.2)抗衡。

  33. 33 T2 Commented @ 2011-06-07 11:24Reply to this comment

    @bcbc linux内核也有人编译出来了,2.6.36记得是…

  34. 34 awd Commented @ 2011-06-07 11:48Reply to this comment

    他把GTK划出去了,结果当然大不一样啦!别忘了GTK的G代表什么?GNU Image Manipulation Program Toolkit。。这是你永远脱不掉的烙印!不要以为换个马甲,我就认不出你了!

  35. 35 awd Commented @ 2011-06-07 11:50Reply to this comment

    你有本事把GNU的那8%拿掉,看看其他92%还能运行吗?呵呵。。

  36. 36 大调 Commented @ 2011-06-07 12:03Reply to this comment

    @awd,一样的,你把其他的拿掉,那GNU的8%就是废物废铁了,没人关注了

  37. 37 大调 Commented @ 2011-06-07 12:04Reply to this comment

    一个写代码的,如果不会欣赏做上面UI的,就只能是Sun的下场了,不要痴迷那GNU的8%

  38. 38 Mike Ma Commented @ 2011-06-07 12:19Reply to this comment

    @依云: 如果gnome3能支持freebsd,我肯定就试试了。。。天天gnu不爽,尤其是gnu那一副姿态

  39. 39 cuihao Commented @ 2011-06-07 12:20Reply to this comment

    这有啥,看看身边的Windows,上面的软件有几个M$的 —— QQ、QQ旋风、QQLive、QQ音乐、QQ工具栏、QQ影音、QQ拼音、QQ五笔、TT浏览器、QQ电脑管家、QQ医生、QQ游戏、QQ堂、QQ影像、QQ词典…… 叫神马“Microsoft Windows”,明明是“疼/Windows”。

  40. 40 Mike Ma Commented @ 2011-06-07 12:22Reply to this comment

    @awd: 在1.x时期这句话有说服力,可惜gimp早就把gtk的管理移交给gnome社区了,准确说现在代表的的gnome toolkit(不限于gnome),只是没有官方确认

  41. 41 csslayer Commented @ 2011-06-07 12:37Reply to this comment

    PLEASE DO NOT FEED THE TROLLS

  42. 42 simsilver Commented @ 2011-06-07 12:52Reply to this comment

    删前留名。

    大家辩论时尽量列证据呗,要不我等旁观众学不到东西的……

  43. 43 microcai Commented @ 2011-06-07 13:11Reply to this comment

    @qii: 勇敢去面对。不要逃避。

  44. 44 by7b Commented @ 2011-06-07 13:26Reply to this comment

    这都什么和什么啊

  45. 45 右京样一 Commented @ 2011-06-07 20:17Reply to this comment

    @csslayer: PLEASE DO NOT FEED THE TROLLS +1 \n 话说换行是这么写的不……我觉得本身统计这东西也就是为了好玩,并无所指。好比汽车发动机和轮子的关系,缺了哪个都没法跑,争论哪个“更重要”实在是没有啥意义啊。

  46. 46 黑日白月 Commented @ 2011-06-07 21:29Reply to this comment

    不好意思,清理了一下评论~

  47. 47 Heiher Commented @ 2011-06-07 22:09Reply to this comment

    @黑日白月: 清理为什么要不好意思呢?

  48. 48 gml520 Commented @ 2011-06-08 7:42Reply to this comment

    @黑日白月:没有什么不好意思的,支持黑兄清理评论,昨天实在是有些冲动了,对不起哈。因为实在看不惯某些人的某些自以为是的言论。

  49. 49 ggarlic Commented @ 2011-06-08 10:36Reply to this comment

    @Mike Ma: gnome全称gnu network object model environment,所以GTK的gnu还是去不掉

  50. 50 thorne Commented @ 2011-06-08 10:51Reply to this comment

    权重很大的吧

  51. 51 kidfruit Commented @ 2011-06-08 21:17Reply to this comment

    围观,最近toy上喷子越来越多了……

  52. 52 iveney Commented @ 2011-06-09 0:02Reply to this comment

    GNU 贡献的是 tool chain 阿, 这可是 foundation.

  53. 53 Robin Commented @ 2011-06-11 2:50Reply to this comment

    很无聊,怎可以以代码行数的比重来衡量GNU的地位