Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #10295 > unrolled thread

apt.Cache.update with alternative sources.list

Started byOle Streicher <olebole@debian.org>
First post2018-03-21 23:40 +0100
Last post2018-03-22 15:30 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.debian.maint.python


Contents

  apt.Cache.update with alternative sources.list Ole Streicher <olebole@debian.org> - 2018-03-21 23:40 +0100
    Re: apt.Cache.update with alternative sources.list Pierre-Elliott Bécue <becue@crans.org> - 2018-03-22 08:30 +0100
    Re: apt.Cache.update with alternative sources.list Paul Wise <pabs@debian.org> - 2018-03-22 15:30 +0100

#10295 — apt.Cache.update with alternative sources.list

FromOle Streicher <olebole@debian.org>
Date2018-03-21 23:40 +0100
Subjectapt.Cache.update with alternative sources.list
Message-ID<vvUyK-8di-19@gated-at.bofh.it>
Hi,

I need some access (as normal user) to an apt cache with an alternative
sources.list (those in /etc/blends/ installed by blends-dev), but I have
problems to find out how to use it.

I first tried to just specify the alternative source file:

```
>>> import apt
>>> c = apt.Cache()
>>> c.update('sources_list='/etc/blends/sources.list.testing')
LockFailedException: Failed to lock /var/lib/apt/lists/lock
```

Then I tried to use an alternative root directory:

```
>>> import apt
>>> c = apt.Cache(rootdir='/tmp/myapttmp')
>>> c.update('sources_list='/etc/blends/sources.list.testing')
FetchFailedException: W:GPG error: http://ftp.debian.org/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010, E:The repository 'http://ftp.debian.org/debian testing InRelease' is not signed.
```

To which place in the new root directory do I need to copy the keyring?
I tried <<rootdir>>/usr/share/keyrings/ but this didn't work.

And/or how can I disable authentication (--allow-unauthenticated,
resp. APT::Get::AllowUnauthenticated)?

Version of python3_apt is 1.4.0~beta3+b1

Best regards

Ole

[toc] | [next] | [standalone]


#10296

FromPierre-Elliott Bécue <becue@crans.org>
Date2018-03-22 08:30 +0100
Message-ID<vw2PD-5pL-1@gated-at.bofh.it>
In reply to#10295

[Multipart message — attachments visible in raw view] — view raw

Le mercredi 21 mars 2018 à 23:12:18+0100, Ole Streicher a écrit :
> Hi,
> 
> I need some access (as normal user) to an apt cache with an alternative
> sources.list (those in /etc/blends/ installed by blends-dev), but I have
> problems to find out how to use it.
> 
> I first tried to just specify the alternative source file:
> 
> ```
> >>> import apt
> >>> c = apt.Cache()
> >>> c.update('sources_list='/etc/blends/sources.list.testing')
> LockFailedException: Failed to lock /var/lib/apt/lists/lock
> ```
> 
> Then I tried to use an alternative root directory:
> 
> ```
> >>> import apt
> >>> c = apt.Cache(rootdir='/tmp/myapttmp')
> >>> c.update('sources_list='/etc/blends/sources.list.testing')
> FetchFailedException: W:GPG error: http://ftp.debian.org/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010, E:The repository 'http://ftp.debian.org/debian testing InRelease' is not signed.
> ```
> 
> To which place in the new root directory do I need to copy the keyring?
> I tried <<rootdir>>/usr/share/keyrings/ but this didn't work.
> 
> And/or how can I disable authentication (--allow-unauthenticated,
> resp. APT::Get::AllowUnauthenticated)?

AFAIK, the apt trusted keyring is normally in /etc/apt/trusted.gpg +
/etc/apt/trusted.gpg.d

So, as long as you're sure the rootdir behaves as you think this should help
you to chose the appropriate place.

-- 
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528  F493 0D44 2664 1949 74E2
It's far easier to fight for one's principles than to live up to them.

[toc] | [prev] | [next] | [standalone]


#10297

FromPaul Wise <pabs@debian.org>
Date2018-03-22 15:30 +0100
Message-ID<vw9o5-1jW-1@gated-at.bofh.it>
In reply to#10295
On Thu, Mar 22, 2018 at 6:12 AM, Ole Streicher wrote:

> I need some access (as normal user) to an apt cache with an alternative
> sources.list (those in /etc/blends/ installed by blends-dev), but I have
> problems to find out how to use it.

If you want to completely isolate apt from the system configuration
for apt, the correct way to do that is to set the APT_CONFIG
environment variable. See apt.conf(5), APT_CONFIG is the first
mechanism used for setting the apt config and /etc is the second place
apt looks for configuration. If you do not want to override every item
(including hooks/etc) in every file in /etc/apt/apt.conf.d then you
need to use APT_CONFIG. Examples of how to do this include chdist
(from devscripts), apt-venv or the derivatives census codebase.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web