On many distributions and the BSDs there are ways to determine the number of packages in the distro's enabled repositories, e.g. on FreeBSD you could use
pkg stats, is there such a way with Ubuntu? I know how to count the number of installed packages, namely using:
dpkg -l | wc -l
which on my Ubuntu 18.04 Bionic Beaver (developmental version) system returns 1962 (and yes I know not to rely on the stability of a developmental release, as things can and often do break, this is just a system for me to satisfy my curiosity about the new release to come), but how do I count all packages in its enabled repositories?
I would imagine that
apt-cache search "*" would return a list of all available packages, which I could then count with
wc -l but no it returns:
E: Regex compilation error