[Bug 1397750] [NEW] Not able to install packages using the PackageKit D-Bus API
Till Kamppeter
1397750 at bugs.launchpad.net
Sun Nov 30 23:20:52 UTC 2014
Public bug reported:
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-printer-escpr
The key fingerprint is
E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56
and the Debian package repository is
deb http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main
This data is polled from OpenPrinting:
https://www.openprinting.org/query.cgi?moreinfo=1&showprinterid=1&onlynewestdriverpackages=0&architectures=amd64&noobsoletes=1&onlyfree=0&onlymanufacturer=0&onlydownload=1&packagesystem=deb&onlysigneddriverpackages=0&format=xml&type=drivers&printer=MFG:EPSON;MDL
:EP-801A%20Series;DES:EPSON%20EP-801A%20Series;CLS:PRINTER;
One can replace the packagesystem=deb in the URL by packagesystem=rpm
for RPM-based distros.
Now I run a script of system-config-printer,
/usr/share/system-config-printer/install-printerdriver.py via the command
install-printerdriver 'epson-inkjet-printer-escpr' 'deb
http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main'
'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'
Or by pasting the commands at the python prompt:
till at 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-inkjet-printer-escpr'
>>> repo = 'deb http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main'
>>> repo_gpg_id = 'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'
>>> pk = PackageKitGlib.Client()
>>> res = pk.install_signature(PackageKitGlib.SigTypeEnum.GPG, repo_gpg_id, '', None, progress, None)
>>> res.get_exit_code()
<enum PK_EXIT_ENUM_SUCCESS of type PkExitEnum>
>>> res = pk.resolve(PackageKitGlib.FilterEnum.NONE, [package], None, lambda p, t, d: True, None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
GLib.Error: pk_client_error: Package name epson-inkjet-printer-escpr could not be resolved. (263)
>>> res = pk.repo_enable(repo, True, None, progress, None)
>>> res = pk.refresh_cache(False, None, progress, None)
>>> res = pk.resolve(PackageKitGlib.FilterEnum.NONE, [package], None, lambda p, t, d: True, None)
>>> package_ids = res.get_package_array()
>>> package_id = package_ids[0].get_id()
>>> package_id
'epson-inkjet-printer-escpr;1.4.1-1lsb3.2;amd64;printdriver'
>>> package_ids[0].get_info() & PackageKitGlib.InfoEnum.INSTALLED
0
>>> res = pk.install_packages(True, [package_id], None, progress, None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
GLib.Error: pk_client_error: The version 1.4.1-1lsb3.2/printdriver of epson-inkjet-printer-escpr isn't available. (263)
>>> res = pk.install_packages(True, ['epson-inkjet-printer-escpr;1.4.1-1lsb3.2;amd64;'], None, progress, None)
>>> res = pk.get_files([package_id], None, progress, None)
>>> files = res.get_files_array()
>>>
The problem is that the step of actually installing the package ("res =
pk.install_packages(..)") errors. It says:
The version 1.4.1-1lsb3.2/printdriver of epson-inkjet-printer-escpr
isn't available.
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-printer-escpr" on
the command line.
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-
config-printer not working any more, therefore i set its importance to
"High".
** Affects: aptdaemon (Ubuntu)
Importance: High
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to aptdaemon in Ubuntu.
https://bugs.launchpad.net/bugs/1397750
Title:
Not able to install packages using the PackageKit D-Bus API
Status in aptdaemon package in Ubuntu:
New
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-printer-escpr
The key fingerprint is
E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56
and the Debian package repository is
deb http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main
This data is polled from OpenPrinting:
https://www.openprinting.org/query.cgi?moreinfo=1&showprinterid=1&onlynewestdriverpackages=0&architectures=amd64&noobsoletes=1&onlyfree=0&onlymanufacturer=0&onlydownload=1&packagesystem=deb&onlysigneddriverpackages=0&format=xml&type=drivers&printer=MFG:EPSON;MDL
:EP-801A%20Series;DES:EPSON%20EP-801A%20Series;CLS:PRINTER;
One can replace the packagesystem=deb in the URL by packagesystem=rpm
for RPM-based distros.
Now I run a script of system-config-printer,
/usr/share/system-config-printer/install-printerdriver.py via the command
install-printerdriver 'epson-inkjet-printer-escpr' 'deb
http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main'
'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'
Or by pasting the commands at the python prompt:
till at 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-inkjet-printer-escpr'
>>> repo = 'deb http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main'
>>> repo_gpg_id = 'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'
>>> pk = PackageKitGlib.Client()
>>> res = pk.install_signature(PackageKitGlib.SigTypeEnum.GPG, repo_gpg_id, '', None, progress, None)
>>> res.get_exit_code()
<enum PK_EXIT_ENUM_SUCCESS of type PkExitEnum>
>>> res = pk.resolve(PackageKitGlib.FilterEnum.NONE, [package], None, lambda p, t, d: True, None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
GLib.Error: pk_client_error: Package name epson-inkjet-printer-escpr could not be resolved. (263)
>>> res = pk.repo_enable(repo, True, None, progress, None)
>>> res = pk.refresh_cache(False, None, progress, None)
>>> res = pk.resolve(PackageKitGlib.FilterEnum.NONE, [package], None, lambda p, t, d: True, None)
>>> package_ids = res.get_package_array()
>>> package_id = package_ids[0].get_id()
>>> package_id
'epson-inkjet-printer-escpr;1.4.1-1lsb3.2;amd64;printdriver'
>>> package_ids[0].get_info() & PackageKitGlib.InfoEnum.INSTALLED
0
>>> res = pk.install_packages(True, [package_id], None, progress, None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
GLib.Error: pk_client_error: The version 1.4.1-1lsb3.2/printdriver of epson-inkjet-printer-escpr isn't available. (263)
>>> res = pk.install_packages(True, ['epson-inkjet-printer-escpr;1.4.1-1lsb3.2;amd64;'], None, progress, None)
>>> res = pk.get_files([package_id], None, progress, None)
>>> files = res.get_files_array()
>>>
The problem is that the step of actually installing the package ("res
= pk.install_packages(..)") errors. It says:
The version 1.4.1-1lsb3.2/printdriver of epson-inkjet-printer-escpr
isn't available.
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-printer-escpr"
on the command line.
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-
config-printer not working any more, therefore i set its importance to
"High".
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/aptdaemon/+bug/1397750/+subscriptions
More information about the foundations-bugs
mailing list