Sometimes we need know if any package is installed in our system, and it is somewhat tedious to open our package manager to after several steps see if it is installed or not.
Here is the way easy and fast to do it from a terminal. |
To find out if a package is available in the repositories, I opened a terminal and typed:
- Arch Linux: pacman -Ss package
- Fedora: yum search package
- Debian / Ubuntu: apt-cache search package
- OpenSUSE: zypper se package
- Gentoo: emerge -S package
To know if a package is installed on our machine:
- Arch Linux: pacman -Qs package
- Fedora: rpm -qa | grep package
- Debian / Ubuntu: dpkg -l | grep package
- OpenSUSE: zypper se -i package
- Gentoo: emerge -pv package
Easy, right?
that is to know if a package is in the repositories, if you want to know if a package is installed ... in Debian
dpkg -l | grep package
Here I send another form, also from the terminal, and more punctual, since the search one can find many packages that start the same:
sudo apt-cache policy
It not only says if it is installed, but also which version is installed and which one in the repositories.
Beware, for Gentoo the parameter is lowercase 's', not uppercase 'S', because 'S' searches within package titles and descriptions (a slower process) while 's' searches only in names. That is, to search for a certain package by a text, you would execute
emerge -s package
In a process similar to the one described by Vjnario for Debian. But to find out if a package is installed or not, and if so which version is installed, you can run
emerge -pv package
These blogs are supposed to be informative, not misleading. Be careful and find out well the information that you publish, to the extent that these things have to be corrected.
fedora:
rpm -qa | grep package
Please mate can you make a new topic on Linux power saving.
Thank you. It would be an important plus.
Thank you! It was my mistake ... it's fixed. Let them know if they detect anything else.
Cheers! Paul.
Thanks for the data! We are also human ... the error has already been corrected.
Regards. Paul.
I'll keep that in mind.
Meanwhile, I leave you some articles that may interest you:
http://usemoslinux.blogspot.com/2012/03/el-nuevo-kernel-finalmente-soluciona-el.html
http://usemoslinux.blogspot.com/2011/03/cpufreq-trayfreq-y-como-ahorrar-energia.html
http://usemoslinux.blogspot.com/2011/08/como-ahorrar-energia-en-linux-usando.html
http://usemoslinux.blogspot.com/2010/10/jupiter-sencillo-gestor-de-energia-para.html
https://blog.desdelinux.net/granola-herramienta-para-ahorrar-energia/
https://blog.desdelinux.net/powertop-ahorra-energia-con-linux-en-procesadores-intel/
http://usemoslinux.blogspot.com/2010/02/wattos-distro-ligera-basada-en-ubuntu.html
Cheers! Paul.
That is bullshit because with synaptic it is much easier and more visual to know if a specific package is installed or not, it would be another thing to see at the same time if there are several packages installed
That's nothing ... In Unity you just write the name of the package (or part of it) in the Dash applications Lens and that's it ... you know at once if it's installed, and if you can't see if it's available ... wham ...!
Interesting! I did not know, I did not know it.
In Arch Linux, to search inside the installed packages is with
pacman -Qs package
no matter what failures ... the important thing is to learn ... thanks for your tutoring ... keep it up !!!!
If you use Aptitude in Ubuntu and Debian instead of dpkg or apt-get, the result will tell you if it is installed (i), pending (p) ...
Good Jose!
Since nobody talks about Slackware ... In Slackware it's very simple, just from the terminal you run: ls / var / log / packages
You have touched a very important point
and in ubuntu? Oo
In Ubuntu the command you indicate does not work, you only look for the name of the package to know if it exists or what it is called but it does not indicate if it is installed or not.
You have to use the second command indicated in the post:
dpkg -l | grep package
Cheers! Paul.
When you write the command dpkg -l it looks like it was a capital i, or a slash |
on the subject: very good post, I'm getting into the world of debian 🙂
Thanks but in Opensuse with that command the version number does not appear,
It would be very useful to me because I do not have access to the graphical environment.
zypper list-updates -t package
if it gives me the current version but only the packages that could be updated therefore the others do not appear ...
Regards!
I just found the installed version number for OpenSuse
zypper info packagename
regards
the command dpkg -l works | grep package, but what would happen if I don't open the package from the menu? This command would be tricking us