Ubuntu 的存储库包含多少百分比的非自由软件?

Pan*_*dya 10 repository proprietary

Debian 的文档确实提到:

请注意,non-free 和 contrib 包的数量不到main 包数量的 2%

Debian 有仓库的三个组成部分main(包括 100%自由软件)、contrib(包括依赖于非自由软件的自由软件)和non-free(包括专有软件)。因此,文档说不到 2% 的主包包含在非自由和 contrib 存储库中。

我想为 Ubuntu 了解同样的事情。Ubuntu 在存储库和Universe存储库上有免费软件,存储库的受限多元宇宙 组件包含非自由软件。

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

Pan*_*dya 6

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

#!/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) %"
Run Code Online (Sandbox Code Playgroud)

输出:

$ ./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 %
Run Code Online (Sandbox Code Playgroud)

对于 Debian GNU/Linux:

$ 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) %"
Run Code Online (Sandbox Code Playgroud)
$ ./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 %
Run Code Online (Sandbox Code Playgroud)

注意:此分析不考虑更新和向后移植存储库