One of the many frequent management tasks is knowing in detail what elements are installed in an operating system since this is useful for procedures such as:
In the case of Linux, many times we may not know in detail how to know and identify what packages we have in our distributions and that is why today TechnoWikis will clearly give some guidelines to know these details with ease. We will do this analysis in Ubuntu 17 ..
1. How to list installed packages with a brief description in Linux Ubuntu
Step 1
If we wish to display the list of packages that are installed in the system, simply execute the following:
dpkg-query -l
Step 2
We will see the following result:
Step 3
If we only want to see the list of packages without any description, we will execute the following:
dpkg-query -f '$ {binary: Package} \ n' -W
As a result we will see this:
2. How to view packages installed on Linux
Step 1
To know what packages we have installed in our distribution, we will use the following line:
dpkg --get-selections | grep -v deinstall
Step 2
We can also use the following line:
apt list –installed
3. How to save the results to a text file in Linux
If for any reason we want the results obtained to be redirected and stored to a text file for later analysis, we will execute the following:
dpkg --get-selections | grep -v deinstall> TechnoWikis.txt>
We can also use the following line:
dpkg -l | grep ^ ii | awk '{print $ 2}'> mylist.txt
4. How to remove unused packages in Linux
It is normal that certain packages are no longer used in Linux and for this they can be eliminated, this will free up disk space, for this task we will execute the following:
sudo apt-get autoremove
We have seen how easy it is to see in detail what packages we have installed in our Linux distribution and thus have better control over them.