Monday 15 September 2014

PackageKit/Python: pk.install_packages() not able to install a package

Hi,

I am using the Python bindings of PackageKit in system-config-printer
for the automatic driver download )as DEB packages in Ubuntu).

s-c-p calls these command lines for example:

install-printerdriver 'openprinting-gutenprint' 'deb
http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib'
'F8897B6F00075648E248B7EC24CBF5474CFD1E2F'

or

install-printerdriver 'epson-inkjet-printer-201209j' 'deb
http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main'
'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'

The script install-printerdriver calls
/usr/share/system-config-printer/install-printerdriver.py which uses
PackageKit to add the supplied repository, install the supplied key and
then install the requested package.

What works for me is the adding of the repository and installing of the
key. The installation of the package via pk.install_packages() function
always fails.

The server could not be the problem, as once run the script and so added
the repo and the key, I can install the package with "sudo apt-get
install ...".

The problem persists also when not supplying the key and also when
running as root (so seems not to be an authentication problem).

To investigate the failure I have removed the "try: ... except: ..."
around the pk.install_packages() and re-run. Then I get the following output

----------
till@till-twist:~/ubuntu/system-config-printer/test$
install-printerdriver 'openprinting-gutenprint' 'deb
http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib'
'F8897B6F00075648E248B7EC24CBF5474CFD1E2F'
Signature key supplied
pk.install_signature
pk.install_signature succeeded
pk.resolve
pk.resolve succeeded
pk.refresh_cache
pk.refresh_cache succeeded
pk.resolve
pk.resolve succeeded
package_id: openprinting-gutenprint;5.2.7-1lsb3.2;amd64;printdriver
package not installed
pk.install_packages
Signature key supplied
Traceback (most recent call last):
File "/usr/share/system-config-printer/install-printerdriver.py",
line 109, in <module>
res = pk.install_packages(True, [package_id], None, progress, None)
GLib.Error: pk_client_error: The version 5.2.7-1lsb3.2/printdriver of
openprinting-gutenprint isn't available. (263)
till@till-twist:~/ubuntu/system-config-printer/test$
----------

and

----------
till@till-twist:~/ubuntu/system-config-printer/test$
install-printerdriver 'epson-inkjet-printer-201209j' 'deb
http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main'
'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'
Signature key supplied
pk.install_signature
pk.install_signature succeeded
pk.resolve
pk.resolve succeeded
pk.refresh_cache
pk.refresh_cache succeeded
pk.resolve
pk.resolve succeeded
package_id: epson-inkjet-printer-201209j;1.0.1-1lsb3.2;amd64;printdriver
package not installed
pk.install_packages
Signature key supplied
Traceback (most recent call last):
File "/usr/share/system-config-printer/install-printerdriver.py",
line 109, in <module>
res = pk.install_packages(True, [package_id], None, progress, None)
GLib.Error: pk_client_error: The version 1.0.1-1lsb3.2/printdriver of
epson-inkjet-printer-201209j isn't available. (263)
till@till-twist:~/ubuntu/system-config-printer/test$
----------

A strange thing here is also that the package ID always ends with
"printdriver" as the Python script does not contain the word
"printdriver" and at least for the Epson driver also the repo path or
package name does not contain this word.

Anyone has an idea what is going on here or how to do further debugging?

Thanks in advance.

Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel