command not found – packagekit plugin

Image via Wikipedia

If you run into problems where you run some command and the command is not found and you have to install it and run the program again then why not use the command not found plugin for Packagekit. Here is the description:

A simple helper that offers to install new packages on the command line using PackageKit.URL

You can install this with the command:

sudo yum install PackageKit-command-not-found.i686


amit@localhost> sl
Command not found. Install package \’sl\’ to provide command \’sl\’? [N/y] y

* Running..
* Resolving dependencies..
* Waiting for authentication..
* Resolving dependencies..
* Downloading packages..
* Checking signatures..
* Testing changes..
* Installing packages..
* Scanning applications..


unbound variable – bash completion not working and having issues with other stuff like command not found.

I generally use vi/vim for all my practical purposes of working with text files. And I have all the vi/vim plugins required to work with the files. This causes the following to be in the skeleton for all the bash scripts that I create:

set -o nounset                              # Treat unset variables as an error

With this all the unbound variables as errors and was problem with all the shell scripts that was being sourced in the startup of bash. So all I had to do was remove this from all the startup scripts and then from the skeleton of the bash script in vim :).

The solution is quite easy but finding this was really a tough task.

PackageKit error File \”/usr/share/PackageKit/helpers/yum/\”, line 1215, in _get_depends_not_installed – Resolved

In packagekit, if you getting the error below:

Traceback (most recent call last):
File \”/usr/share/PackageKit/helpers/yum/\”, line 1215, in _get_depends_not_installed
rc, msgs =  self.yumbase.buildTransaction()
File \”/usr/lib/python2.6/site-packages/yum/\”, line 719, in buildTransaction\’postresolve\’, rescode=rescode, restring=restring)
File \”/usr/lib/python2.6/site-packages/yum/\”, line 179, in run
func(conduitcls(self, self.base, conf, **kwargs))
File \”/usr/lib/yum-plugins/\”, line 71, in postresolve_hook
if opts.remove_leaves or remove_always:
AttributeError: \’NoneType\’ object has no attribute \’remove_leaves\’

then you can resolve it. The solution to the problem is there in the traceback, luckily this time.

So, the problem is with the remove_leaves plugin. Simply remove the plugin and see packagekit working again.

sudo yum remove yum-plugin-remove-with-leaves