首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu的存储库包含多少非免费软件?

Ubuntu的存储库包含多少非免费软件?
EN

Ask Ubuntu用户
提问于 2020-06-18 12:37:17
回答 1查看 674关注 0票数 11

Debian的文档确实提到:

请注意,非免费和控制包的数量是less的2%的主要软件包。

Debian有三种存储库组件main (包括100% 自由软件s)、contrib (包括依赖于非自由软件的免费软件)和非免费(包含专有性软件)。因此,文档是说,不到2%的主包包含在非免费和控制存储库中。

对于Ubuntu我也想知道同样的事情。Ubuntu在宇宙存储库和受限多体存储库上都有免费软件,存储库的组件包含非自由软件。

现在,与主存和宇宙储存库相比,这些受限和多元的软件包含了多少非自由软件?我们有这样的分析吗?

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2020-06-24 06:03:43

虽然我没有在Ubuntu的文档中找到这样的信息,但是我创建了一个简单的脚本来手动计算它:

代码语言:javascript
复制
#!/bin/bash

ubuntu_main=$(lynx -dump http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-amd64/Packages.gz | grep ^Package: | wc -l)
ubuntu_universe=$(lynx -dump http://archive.ubuntu.com/ubuntu/dists/focal/universe/binary-amd64/Packages.gz | grep ^Package: | wc -l)
ubuntu_restricted=$(lynx -dump http://archive.ubuntu.com/ubuntu/dists/focal/restricted/binary-amd64/Packages.gz | grep ^Package: | wc -l)
ubuntu_multiverse=$(lynx -dump http://archive.ubuntu.com/ubuntu/dists/focal/multiverse/binary-amd64/Packages.gz | grep ^Package: | wc -l)

percentage="($ubuntu_restricted+$ubuntu_multiverse)/($ubuntu_main+$ubuntu_universe)"

echo "Total number of packages on Ubuntu's main repository = $ubuntu_main"
echo "Total number of packages on Ubuntu's universe repository = $ubuntu_universe"
echo "Total number of packages on Ubuntu's restricted repository = $ubuntu_restricted"
echo "Total number of packages on Ubuntu's multivrese repository = $ubuntu_multiverse"

echo "Percentage of non-free packages on Ubuntu's repositories= $(echo $percentage*100 | bc -l) %"

输出:

代码语言:javascript
复制
$ ./sample 
Total Packages on Ubuntu's main repository = 6090
Total number of packages on Ubuntu's universe repository = 53206
Total number of packages on Ubuntu's restricted repository = 143
Total number of packages on Ubuntu's multivrese repository = 813
Percentage of non-free packages = 1.61225040474905558500 %

对于Debian /Linux:

代码语言:javascript
复制
$ cat sample 
#!/bin/bash

debian_main=$(lynx -dump http://ftp.debian.org/debian/dists/buster/main/binary-amd64/Packages.gz | grep ^Package: | wc -l)
debian_contrib=$(lynx -dump http://ftp.debian.org/debian/dists/buster/contrib/binary-amd64/Packages.gz | grep ^Package: | wc -l)
debian_nonfree=$(lynx -dump http://ftp.debian.org/debian/dists/buster/non-free/binary-amd64/Packages.gz | grep ^Package: | wc -l)

percentage="($debian_contrib+$debian_nonfree)/($debian_main)"

echo "Total number of packages on Debian's main repository = $debian_main"
echo "Total number of packages on Debian's contrib repository = $debian_contrib"
echo "Total number of packages on Debian's non-free repository = $debian_nonfree"

echo "Percentage of non-free packages on Debian GNU/Linux = $(echo $percentage*100 | bc -l) %"
代码语言:javascript
复制
$ ./sample 
Total number of packages on Debian's main repository = 56873
Total number of packages on Debian's contrib repository = 293
Total number of packages on Debian's non-free repository = 602
Percentage of non-free packages on Debian GNU/Linux = 1.57368171188437395600 %

注意:此分析不考虑更新和后端存储库。

票数 7
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1251528

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档