[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to download source package using only console?



On 2023-05-15 10:25:45 +0500, Alexander V. Makartsev wrote:
> On 15.05.2023 05:43, Vincent Lefevre wrote:
> > But my point is that your database is obsolete, because if you ask
> > the version from testing, apt thinks that it is 3.2.0-3.1, while it
> > should be 4.9.1-1. You need to fix that.
> What is the best approach to fix that? [...]

That:

[...]
> I see. That explains why I can request source package
> "golang-github-xenolf-lego/testing" directly and get the right one.
> So, in my case, I won't be able to reliably get a source package(-s) from
> "testing" if I don't add "deb" part of "testing" to "sources.list", which
> could be a different can of worms...
> Is this something for me to just be aware of and leave it as is now, or is
> there more elegant solution?

Well, if you don't want the "deb" part, you need to provide the
name of the source package directly to "apt source". If you do that
frequently, you can write a script. There are 2 solutions:
* A remote request, e.g. with rmadison.
* Something based of "apt cache show". From that, you can get the
  source package, then call "apt source" with the source package.
  But note that this is only a heuristic; if the name of the source
  package has changed from stable to testing, this won't work.

Note that adding the "deb" part shouldn't be much an issue (except
noise, e.g. with "apt cache show", which would give output for both
stable and testing). If you want to make sure that a package from
testing won't be installed by mistake (by apt), I suppose that you
can use apt preferences with a negative priority for testing to
prevent such an installation:

Package: *
Pin: release a=testing
Pin-Priority: -1

(not tried). See the apt_preferences(5) man page for details.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: