Not able to install packages using the PackageKit D-Bus API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
aptdaemon (Ubuntu) |
Fix Released
|
High
|
dominik sladek | ||
Utopic |
New
|
High
|
Unassigned | ||
system-config-printer (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Utopic |
Fix Released
|
High
|
Unassigned |
Bug Description
I am on Ubuntu Utopic (14.10) and want to do the following, preferably
with a Python script.
I want to install a printer driver package from Epson (which is
available as both DEB and RPM) through its apt or yum repository so that
future updates get installed automatically through the distro's update
mechanism. I also want to assure by means of a key fingerprint that
repository and package are really from Epson.
The package name for example is
epson-inkjet-
The key fingerprint is
E5220FB7014D0FB
and the Debian package repository is
deb http://
This data is polled from OpenPrinting:
One can replace the packagesystem=deb in the URL by packagesystem=rpm
for RPM-based distros.
Now I run a script of system-
/usr/share/
install-
http://
'E5220FB7014D0F
Or by pasting the commands at the python prompt:
till@till-twist:~$ python3
Python 3.4.2 (default, Oct 8 2014, 13:08:17)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GLib, PackageKitGlib
>>> import sys
>>> def progress(progress, type, user_data):
... pass
...
>>> package = 'epson-
>>> repo = 'deb http://
>>> repo_gpg_id = 'E5220FB7014D0F
>>> pk = PackageKitGlib.
>>> res = pk.install_
>>> res.get_exit_code()
<enum PK_EXIT_
>>> res = pk.resolve(
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
GLib.Error: pk_client_error: Package name epson-inkjet-
>>> res = pk.repo_
>>> res = pk.refresh_
>>> res = pk.resolve(
>>> package_ids = res.get_
>>> package_id = package_
>>> package_id
'epson-
>>> package_
0
>>> res = pk.install_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
GLib.Error: pk_client_error: The version 1.4.1-1lsb3.
>>> res = pk.install_
>>> res = pk.get_
>>> files = res.get_
>>>
The problem is that the step of actually installing the package ("res = pk.install_
The version 1.4.1-1lsb3.
So the version number is messed up ("/printdriver" added) and therefore the package not found. If I manipulate the package ID somewhat, removing the "printdriver" in the end, the package installation works (I have checked in another terminal that the package got actually installed).
The same error occurs with "pkcon install epson-inkjet-
The problem seems not to be caused by the transition from Python 2 to Python3. I can paste the command sequence above also into Python 2 and get the same results.
Please check whether this is really caused by aptdemon, perhaps it can also be the PackageKit client.
Yje bug makes the automatic printer driver installation by system-
tags: | added: utopic |
Changed in aptdaemon (Ubuntu): | |
assignee: | nobody → dominik sladek (domdeejay) |
Added system- config- printer task for a workaround applied to system- config- printer (in version 1.5.3+20141029- 0ubuntu2) . Note that this is a workaround, the bug is still in aptdaemon.