Ubuntu – How much percentage of non-free softwares do Ubuntu’s repositories contain

proprietaryrepository

Debian's documentation does mention that:

Please note that the number of non-free and contrib packages is less than 2% of that of main packages.

Debian have three components of repository: main (which include 100% free softwares), contrib (which includes free softwares that depends upon non-free softwares) and non-free (which contains proprietary softwares). So, the documentation is saying that less than 2% of that of main packages are contained in non-free and contrib repositories.

I want to know the same thing for Ubuntu. Ubuntu has free softwares on main and universe repositories and restricted and multiverse components of repositories contain non-free softwares.

Now, how much percentage of non-free softwares are contained by these restricted and multiverse repositories compared to that of main and universe repositories? Do we have any such analysis?

Best Answer

Though I didn't find such information on Ubuntu's documentation, I created a simple script to calculate it manually:

#!/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) %"

Output:

$ ./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 %

For 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) %"
$ ./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 %

Note: update and backport repositories are not considered for this analysis