aptly icon indicating copy to clipboard operation
aptly copied to clipboard

Resolve and add automatically dependencies from a local repository to a mirror of Ubuntu

Open BrightGum opened this issue 4 years ago • 6 comments

Is it possible and how to resolved and add automatically dependencies of a local repository (own .deb files) to a mirror? The scope of the mirror (of Ubuntu 20.04) is limited by filter. What is the best way to merge them?

BrightGum avatar Jun 28 '21 10:06 BrightGum

I feel in no position about talking about the best way, but I think I know some way.

I am assuming you are either packaging packages not conflicting with what is is available in focal, or doing so with packages that are of a higher version than those distributed for focal. If you are not, I think this is what you should fix, as it is easier to change a conflicting name or bump a version than to tell aptly to do this for you.

Enough lecture, try this:

  • Get a list of the packages in your local repository
  • Merge a snapshot of your local repository with a snapshot of all of Ubuntu focal
  • Create a filtered snapshot from this using all the packages you have in your local repository, following dependencies

You should end up with a snapshot containing exactly what your packages need, ready to be published.

I hope I could help, please close the issue if it does, otherwise, I hope to be able to help you out further.

ETA: If you want to change what you are fetching, you can apply the set of packages resulting from the third step (minus your own packages) to the next mirror update filter and use the snapshot verify feature to know you have not missed a new dependency brought in by your packages or a package they are depending on. (Please note that you will still have to catch packages that are no longer dependencies using the first-mentioned approach.)

r4co0n avatar Jul 03 '21 19:07 r4co0n

Do you see a way to do that without a complete snapshot of Ubuntu focal? Currently I solve it by adding the dependencies of the local repository to the filter list for the filtered Ubuntu snapshot. My goal is to minimize the size.

Yes, the snapshot verify is very helpful.

BrightGum avatar Jul 07 '21 13:07 BrightGum

As long as you have a list of the leaf-dependency packages, meaning a list of the packages that you want available on the mirror that do not depend on each other, you can pass those as a package query filter to aptly mirror create or aptly mirror edit, using the -filter-with-deps option and an or-ed list of your packages, e.g. package1|package2|package3.

Do you want to create a stand-alone ubuntu mirror or is this supposed to be an auxiliary mirror added alongside the original ubuntu mirrors?

Do you prefer omitting a complete mirror sync because of space- and/or time-constraints or do you have another reason?

r4co0n avatar Jul 10 '21 09:07 r4co0n

Hi, I was looking for the same possibility as @BrightGum, to be able to create a snapshot with our own software deb packages, and their dependencies. Dependencies are coming from official Debian or Ubuntu repos.

I wanted to be able to do this without mirroring a full official repo, for time and storage constraints.

Is there a way to do this without having the full list of leaf-dependencies for every software ?

ryanammoury avatar Feb 09 '22 00:02 ryanammoury

@ryanammoury - In your case it would seem trivial to pass all of your own packages' dependencies (as listed in control file - See Package Interrelationship fields and note that you don't want to look at all of those fields.) as a filter to aptly.

Having created a snapshot of your own packages, you can use aptly snapshot verify to get a list of packages to pass to your filter for offical Debian/Ubuntu mirrors.

r4co0n avatar Feb 16 '22 09:02 r4co0n

Hi @r4co0n,

Thanks for your answer. It's comforting to know that, as it's the solution I opted for.

I just used chdist, and the chdist apt-rdepends command to work out all of the dependencies for me, as they are spread accross multiple repos.

I then mirror and snapshot said repos, and merge them in a final snapshot. The aptly snapshot verify confirmed that no dependencies were missing in the final snapshot.

ryanammoury avatar Feb 16 '22 10:02 ryanammoury