hi, I am new to all of this and I am stuck on a very simple command
I want to find how many total packages are installed on the remote machine.
I have tried
dpkg -l | wc -l
dpkg --get-selections | grep install | wc -l
apt list | wc -l
Nothing from above is correct and every single of them has another result.
Has anyone an idea what’s going wrong?
I still tried first apt list --installed | wc -l and i received the result with the command with number minus 1.
Can somebody explain me, why?
Thank you in advance.
i had the same question with apt list --installed | wc -l. wc -l does count every single line of the output and apt list --installed first line is just informational.
With the use of grep you can filter out the informational line.