python-apt complains even if trusted=yes in sources.list

Bug #1693930 reported by Bryan Seitz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Any help would be appreciated.

python-apt - 1.1.0~beta1build1

--- Python Code ---

import apt
import re
import sys
from distutils.version import LooseVersion

cache = apt.Cache(memonly=True, rootdir='/home/seitz/tmp/apt_root')
try:
    cache.update(sources_list='/home/seitz/tmp/apt_root/etc/apt/sources.list', raise_on_error=False)
except Exception as e:
    print e
    pass
cache.open(None)

kernel_versions = {}
for pkg_name in cache.keys():
    kernel_version = re.search(r'linux-image-([\d\-\.]+)-generic', pkg_name)
    if kernel_version:
        distro_re = re.search(r'^([A-Za-z]+)-?', cache[pkg_name].candidate.origins[0].archive)
        if distro_re:
            distro = distro_re.group(1)
        else:
            distro = 'custom'

        major_minor = re.search(r'^(\d+.\d+)', kernel_version.group(1))
        kernel_versions.setdefault(distro, {})
        kernel_versions[distro].setdefault(major_minor.group(1), [])
        kernel_versions[distro][major_minor.group(1)].append(kernel_version.group(1))

for distro in sorted(kernel_versions):
    print "{}:".format(distro)
    for major_minor in sorted(kernel_versions[distro], key=lambda s: map(int, s.split('.')), reverse=True):
        kernel_versions[distro][major_minor].sort(key=LooseVersion)
        print "\t{}:".format(major_minor)
        print "\t\t{}".format(kernel_versions[distro][major_minor].pop())

--- Output ---
seitz@host ~ % python apt-get-latest.py
W:GPG error: http://infra-mirror/ubuntu artful-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:GPG error: http://infra-mirror/ubuntu artful InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:GPG error: http://infra-mirror/ubuntu artful-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:GPG error: http://infra-mirror/ubuntu artful-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:GPG error: http://infra-mirror/ubuntu zesty-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:GPG error: http://infra-mirror/ubuntu zesty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:http://host/annex-apt-precise/apt/precise/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1), W:GPG error: http://infra-mirror/ubuntu zesty-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:GPG error: http://infra-mirror/ubuntu zesty-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32, W:http://host/annex-apt-precise/apt/precise/dists/precise-backports/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1), W:http://host/annex-apt-precise/apt/precise/dists/precise-security/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1), W:http://host/annex-apt-precise/apt/precise/dists/precise-updates/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1), E:Failed to fetch http://host/annex-apt-precise/apt/precise/dists/precise-backports/main/i18n/Translation-en 404 Not Found [IP: 10.40.25.157 80], E:Failed to fetch http://host/annex-apt-precise/apt/precise/dists/precise-security/main/i18n/Translation-en 404 Not Found [IP: 10.40.25.157 80], E:Failed to fetch http://host/annex-apt-precise/apt/precise/dists/precise-updates/main/i18n/Translation-en 404 Not Found [IP: 10.40.25.157 80], E:Some index files failed to download. They have been ignored, or old ones used instead.
artful:
        4.10:
                4.10.0-21
custom:
        3.16:
                3.16.0-77
precise:
        3.2:
                3.2.0-23
xenial:
        4.10:
                4.10.0-14
        4.8:
                4.8.0-36
        4.4:
                4.4.0-78
yakkety:
        4.8:
                4.8.0-53
zesty:
        4.10:
                4.10.0-20

--- Sources.list ---
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu artful-backports main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu artful main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu artful-security main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu artful-updates main universe restricted

deb [arch=amd64 trusted=yes] http://host/apt-kernel/apt/3.16.0-77 3.16.0-77 main
deb [arch=amd64 trusted=yes] http://host/annex-apt-precise/apt/precise precise-backports main universe
deb [arch=amd64 trusted=yes] http://host/annex-apt-precise/apt/precise precise main universe
deb [arch=amd64 trusted=yes] http://host/annex-apt-precise/apt/precise precise-security main universe
deb [arch=amd64 trusted=yes] http://host/annex-apt-precise/apt/precise precise-updates main universe

deb [arch=amd64 trusted=yes] http://host/annex-apt-custom-xenial/apt/custom-xenial custom-xenial main
deb [arch=amd64 trusted=yes] http://host/annex-apt-xenial/apt/xenial xenial-backports main universe restricted
deb [arch=amd64 trusted=yes] http://host/annex-apt-xenial/apt/xenial xenial main universe restricted
deb [arch=amd64 trusted=yes] http://host/annex-apt-xenial/apt/xenial xenial-security main universe restricted
deb [arch=amd64 trusted=yes] http://host/annex-apt-xenial/apt/xenial xenial-updates main universe restricted

deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu yakkety-backports main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu yakkety main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu yakkety-security main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu yakkety-updates main universe restricted

deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu zesty-backports main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu zesty main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu zesty-security main universe restricted
deb [arch=amd64 trusted=yes] http://infra-mirror/ubuntu zesty-updates main universe restricted

Revision history for this message
Julian Andres Klode (juliank) wrote :

trusted only changes the behaviour when downloading packages and stuff. You probably want allow-weak, allow-insecure. Though I do not recommend it, I'm not sure why you are doing this.

affects: python-apt (Ubuntu) → apt (Ubuntu)
Changed in apt (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.