1

I am creating a local repository which will contain all the debians (debs) for Ubuntu. It will also contain kernel debians for 2 different branches like say 1.1 and 2.1

I have created a single empty debian package, say test-package which contains information for all other dependent debians from same repo. Currently it has information on kernel 1.1.

Structure of local repo is as follows:

The folder dists/xenial/release/test-package contains folders k, l, m, v which contain debs.

The folders binary-amd64 and binary-i386 are also created which contains Packages file for corresponding architectures.

Steps performed on the client machine:

  1. Adding URL in sources.list
  2. Running command apt-get install test-package

My issue is:

How can I inform sources.list to pick specific kernel installation and its corresponding debians (debs) available from local repo. i.e. it should install either 1.1 or 2.1 kernel.

TIA

Zanna
  • 69,223
  • 56
  • 216
  • 327
Pulkit Lall
  • 139
  • 1
  • 10
  • What do you mean by "debians" in this context? – waltinator Aug 23 '18 at 13:11
  • I think that by "debians" you mean debian packages, usually referred to on this site as *packages*, or *deb packages*. Is that right? Your question has been flagged as too broad, probably because of the numbered list of requirements. I'm not sure this question really is too broad, but if you [edit] this and remove points 2. and 3. from the list, you might be more likely to get an answer, and you can ask a new question for each of the other points if needed. – Zanna Aug 23 '18 at 17:50
  • @waltinator debians is usually referred to deb packages. – Pulkit Lall Aug 24 '18 at 06:30
  • @Zanna Thank you for your opinion. Will edit and remove points 2 and 3. – Pulkit Lall Aug 24 '18 at 06:31
  • @PulkitLall but I don't think I have ever heard anyone call deb packages "debians". Also: You don't use `sources.list` to tell apt to prefer one set of packages from a repo over another. That's what `preferences` are for. – muru Aug 24 '18 at 07:06
  • @muru Will preferences be able to install test-package with kernel 1.1 or test-package with 2.1? My aim is to install test-package for kernel 1.1 or 2.1 i.e. when I do sudo apt-get install test-package, I should be able to install 1.1 or 2.1 depending on what I want. – Pulkit Lall Aug 24 '18 at 07:48
  • @PulkitLall for that you can just do `sudo apt-get install test-package=1.1` (or `=2.1`) – muru Aug 24 '18 at 08:09
  • @muru The method mentioned is for test-package version and not for kernel version. Package name is same, only difference is kernel. – Pulkit Lall Aug 24 '18 at 08:41
  • Thanks @muru, your line "sudo apt-get install test-package=1.1" had given me some idea and now am able to install it as required. Had tried your command but it was not what I wanted. – Pulkit Lall Aug 24 '18 at 09:37
  • In that case you can post an answer describing what worked for you. – muru Aug 24 '18 at 09:38
  • **Upvoted both question and answer as this might benefit someone else. Not really a duplicate**. If this would be closed, ping me @Fabby and I will start the re-open process. – Fabby Aug 24 '18 at 12:22

1 Answers1

2

Created 2 separate debs for 1.1 and 2.1 and kept in same repo server i.e. In my repo server dists/xenial/release/test-package is created and inside this folder in folder 't' I created 2 debs i.e. test-package-1.1 and test-package-2.1.

Added

http://[server]/ubuntu/dists xenial/release test-package

in sources.list.

Now when I run apt-get install test-package-1.1, it installs 1.1 package and similarly for 2.1.

Not sure if this is correct approach but it is working for me as desired.

Zanna
  • 69,223
  • 56
  • 216
  • 327
Pulkit Lall
  • 139
  • 1
  • 10