You can use the dpkg -l command to list all the packages that are installed on your system:
root@ubuntu-linux:~# dpkg -l
You can also use the apt-cache pkgnames command to list all the packages that are available for you to install:
root@ubuntu-linux:~# apt-cache pkgnames
libdatrie-doc
libfstrcmp0-dbg
libghc-monadplus-doc
librime-data-sampheng
python-pyao-dbg
fonts-georgewilliams
python3-aptdaemon.test
libcollada2gltfconvert-dev
python3-doc8
r-bioc-hypergraph
.
.
.
.
.
You can pipe the output to the wc -l command to get the total number of available packages:
root@ubuntu-linux:~# apt-cache pkgnames | wc -l 64142
Wow! That’s a massive number; over 64,000 available packages on my system.
You may also be interested to know which repositories (sources) your system used to obtain all these packages. These repositories are included in the file /etc/ap- t/sources.list and in any file with the suffix .list under the directory /etc/apt/- sources.list.d/. You can check the man...