How do I check if a package is installed on my server?


I am writing a new answer as Tasksel 'Task names' DO NOT show up in dpkg or apt queries. Meaning the other answers are incomplete (or wrong).

"I can't remember If I have checked the 'virtual machine host' checkbox. How do I check if my server has the corresponding packages?"

1st check if there is an asterisk by the name after re-running sudo tasksel (or an ' i ' if running tasksel --list-tasks). If you do not see this, then you probably do not have the tasksel 'meta-package' installed in the first place.

With that said, if you still want to find out what is installed under the Virtual Machine Host tasksel meta-package:

tasksel --list-tasks

(in your case tasksel --list-tasks | grep virt is enough)

This gives the proper task name and an indication whether it is installed. In your case this task name is 'virt-host'.

"What packages come with the virtual machine host?"

From the last command, find the tasksel task name. This is...

0 0

I am getting error like:

Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/local/lib/php/Mail/smtp.php on line 348

Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/local/lib/php/Mail/smtp.php on line 348

Fatal error: Class 'Net_SMTP' not found in /usr/local/lib/php/Mail/smtp.php on line 349

My code:

require_once 'Mail.php'; $from = ">"; $to = ">"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = ""; $username = "me"; $password = "test"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("

" ....

0 0

am a new Linux system user. How do I find out if a package installed on my Linux based system using the command line option?

A Linux package is nothing but a collection of files and information about those files. Almost all software (web/database server or office app or web browser) on Linux installed using packages. The command to finding out if a package is installed in Linux depends upon your Linux distribution. Following are commands for different distributions.

Debian / Ubuntu Linux

Use dpkg command. It is a package manager for Debian/Ubuntu Linux. Suppose you want to find out package apache-perl or sudo is installed or not, type command:
$ dpkg -s apache-perl
Sample outputs:

dpkg-query: package 'apache-perl' is not installed and no information is available Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg --contents (= dpkg-deb --contents) to list their contents.

Another example:
$ dpkg -s sudo

0 0

I keep getting answers like:

yum list installed | grep bind


rpm -qa | grep bind

But that is not accurate as I'm getting a list of few other bind packages like these:

bind-utils-9.8.2-0.17.rc1.el6_4.5.x86_64 rpcbind-0.2.0-11.el6.x86_64 bind-libs-9.8.2-0.17.rc1.el6_4.5.x86_64 samba-winbind-3.6.9-151.el6.x86_64 samba-winbind-clients-3.6.9-151.el6.x86_64 ypbind-1.20.4-30.el6.x86_64

That is not I wanted. Instead I would want to accurately check if bind core package has been installed. Eg. bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6

I was hoping for something like:

yum check installed bind

But hopefully someone could shed the...

0 0

what’s a good way to check if a package is installed while within a Python script? I know it’s easy from the interpreter, but I need to do it within a script.

I guess I could check if there’s a directory on the system that’s created during the installation but I feel like there’s a better way. I’m trying to make sure the Skype4Py package is installed, and if not I’ll install it.

My ideas of accomplishing the checkage

check for a directory in the typical install path try to import the package and if an exception is throw, then install package

Thanks for any help!

Customize Installed Python Package?

Is it possible to modify the installed Python package so as to customize it for my purpose? To be more specific, I wish to modify the Dynamic Time Warping (DTW) functions in the mlpy package. These de

Check if a package is installed

Is there an elegant and more Python-like way to check if a package is installed on Debian? In a bash...

0 0

I have a bunch of Linux build slaves that use Python to run automated test for each build. Each python environment requires a specific list of modules to be installed (some requiring specific versions as well). I am trying to write a python script that will go to each machine and check to see if a list of python packages are installed or not as well as checking versions of several packages. I have this working for the local machine but looking for suggestions on the best way to check a remote machine.

For reference, on the local machine I'm using this in a try/except to check to see if the module is installed


and this to check the particular version


Any suggestions on the best way to do this for a remote system?

Once you've SSH'd into the machine, pip freeze and grep should work for finding if the module is installed.

Further reading:...

0 0

Learn to check if package is installed on Linux server or not. Verify package availability on server along with its installed date.

Package installation on Linux sometimes fails saying ‘package is already installed; nothing to do’. To avoid this you need to first check if package is installed on system or not and then attempt its installation. In this article we will be seeing different ways we can check if package is installed on server and also check its installation date.

Package management related reads :

Different ways to check if package is installed or not :

On RPM based system –

RPM based systems like Red Hat, Cent OS etc, we can use rpm query command like below :

We are using -qa i.e. query all options which will list all installed packages on system. We are grepping out our desired (telnet in this example) package name. If output is blank then package is not installed. If its installed then respective name will be shown (like...

0 0

Before installing a package on your ubuntu, its a best practice to check if that package installed already. Many of the popular packages are pre installed with all the linux distribution these days. Use “dpkg” tool to check if a package is installed ubuntu server. This command will be helpful n verifying the installed package, checking the package version, architecture, description, etc. This command will work with all Ubuntu servers like Ubuntu 12.04, Ubuntu 14.04, Ubuntu 14.10, etc.

How to check if a package is installed ubuntu

In this example, we are going to check if the Clam antivirus is installed on my Ubuntu server. Clam is one of the best antivirus for all the linux distributions including Ubuntu.

Command usage ( The -l switch stands for List )

dpkg -l


sreekanth@DigitPAGE:~$ sudo dpkg -l clamav

Sample output that got for me

||/ Name Version Architecture ...

0 0

How do I check when RPM packages were installed on my machine?


You can use the following command to display the install date and time of all the packages installed on your system:

If you have a vague idea of the package name pipe (pipe is | key) the output of the above command through


and use a substring that would be in the package name.

For example, to search for packages containing the substring "kernel".

rpm -qa --last | grep kernel

(Returns the install date and time for all packages with kernel in their name, such as the kernel, kernel-utils, etc.)

If you know the exact name for the package, you can modify the command and specify the package name. For example:

(Returns the install date and time of the filesystem package)

Best Regards,
eUKShane :P

0 0


What is CentOS Linux?How long after Red Hat publishes a fix does it take for CentOS to publish a fix?Where are the Release Notes for a given version?How do I get Updates?Many RPMs still contain the name redhat, rhel, or rh. Shouldn't these be changed?Does CentOS change the upstream Source RPMs?Is there a Contrib area?What is CentOS's relationship with Red Hat®, Inc. or RHEL?Where can I get package XyZ.rpm for CentOS?What architectures are supported?Why does YUM complain about missing a GPG key under CentOS? Or I just installed CentOS and yum keeps reporting that the correct GPG key is not installed. How do I install it?The upstream provider offers Enterprise Linux in several flavors, AS, ES, WS, PWS, etc. Which one is CentOS like?How can I easily compare what major package versions are in each version of CentOS?What are all the CentOS repositories (directories) and what is each one for?How do I download and burn the CentOS isos?Can I add X to my server after install?...
0 0

How do I restore (downgrade/upgrade) my device to a non-latest iOS version above iOS 5.0?

Information for iOS 6.x, 7.x, or 8.x on iPhone 4S, iPhone 5, iPhone 5C, iPhone 5S, iPhone 6, iPhone 6 Plus, iPad 2, iPad 3rd generation, iPad 4th generation, iPad Mini, iPad Mini 2, iPad Air, or iPod touch 5th generation

If you have one of these devices on iOS 6.x, 7.x, or 8.x, there is currently no way to downgrade, upgrade, or restore it to any version of iOS that isn't the newest available version of iOS, even if you have SHSH blobs. You can only restore it to the newest available version of iOS.

(The exception is the iPad 2 - if you have iOS 4.x and 5.x SHSH blobs saved, you can downgrade it from iOS 6.x to 5.x using redsn0w. Keep reading for instructions on this.)

Information for iOS 6.x, 7.x, or 8.x on iPhone 4S, iPhone 5, iPhone 5C, iPad 2, iPad 3rd generation

Some devices and firmwares can be restored to by using Odysseus. This requires that you...

0 0