Score:4

Can I apt install ./meta-pkg_1.0_all.deb that will depend on local .deb?

us flag

I have a number .deb packages I create and install:

  • pkg1_1.0_all.deb
  • pkg2_1.0_all.deb
  • pkg3_1.0_all.deb

I'm able to install them using sudo dpkg -i pkg1_1.0_all.deb.

Now I want to create a meta package that will depend on all of them, allowing me to only install sudo dpkg -i meta_1.0_all.deb.

I used equivs to create a control file:

Section: misc
Priority: optional
Standards-Version: 3.6.2

Package: bla
Version: 1.0
Depends:
Description:
 long description and info
 .
 second paragraph

and install it.

Then I modified the Depends: to depend on a known package: Depends: tmux and installed it.

Next, I tried to depend on my custom packages: Depends: pkg1 and now installation broke:

dpkg: dependency problems prevent configuration of bla:
 bla depends on pkg1; however:
  Package pkg1 is not installed.

which is understandable, as pkg1 is indeed not installed.

I have added my local directory as a debian source following this guide (changed one thing - added [trusted=yes] to the sources list deb [trusted=yes] file:... so it would work)

I hoped this would allow me to sudo apt install ./meta_1.0_all.deb and it would find the dependent package in my current dir, but it failed again with the same error.

What can I do to allow user to install one .deb and to make it install several local .deb packages?

ru flag
It will not automatically install local .deb files that aren't in a repository,. You would have to do that manually - `apt install bla /local/path/local1.deb /local/path/local2.deb ...` - unless you also add these 'local packages' to a repository server.
CIsForCookies avatar
us flag
@ThomasWard so if they were uploaded to a server - I would have been able to install one .deb and get all, but if they are in a local repository - I'm not?
user.dz avatar
ng flag
Possible solution is flat/trivial repository, it can be just local directory (no need for server, if not to be shared through network). See https://askubuntu.com/a/615932/26246
mchid avatar
bo flag
Also, someone in the [comment section](https://www.linuxwave.info/2009/04/adding-local-directory-to-apt.html#c2620391824185814815) mentioned that you need to use `deb file:/home/foo/debs /` instead of `file:// /home/foo/debs` on newer versions of Ubuntu.
CIsForCookies avatar
us flag
@mchid that is weird. I have tried it on Ubuntu20.04 and 18.04 with the `file:///` format, and it worked (unless newer is newer than 20.04)
CIsForCookies avatar
us flag
@user.dz I'm not sure what is the difference in your solution (the `Release` and `Packages` files actually make a difference here? I also have my `Packages.gz` file and it didn't work like your solution), but it works! It tells me the package cannot be authenticated (obviously), but it's nothing a good old `yes | sudo apt install <path>` can't handle. Thanks!! (wanna write it as an answer so I can accept it?)
user.dz avatar
ng flag
@CIsForCookies `dpkg` is core tool but it is not aware of repositories, it just handle `.deb` packages individually. `apt` (or `apt-get`) is higher level tool which handle following package dependencies through repositories. So your packages should be served through repository (even if is just local directory). Last step to fix authentication, is to sign Release file following this https://wiki.debian.org/SecureApt#Setting_up_a_secure_apt_repository . You may write the answer that works for you, I don't mind.
user.dz avatar
ng flag
@CIsForCookies Btw, Packages.gz may not work because of how repo is declared in sources.list or location of packages.gz is not where `apt` is expecting it.
mchid avatar
bo flag
If the answer for [What layout/files should debian repository have?](https://askubuntu.com/questions/606527/what-layout-files-should-debian-repository-have) worked, we can close this as a duplicate.
nobody avatar
gh flag
is this https://help.ubuntu.com/community/MetaPackages are you looking for?
Score:3
bo flag

You can glob (use a wildcard *) the install command:

sudo apt install ./*.deb

This will select all the packages to install, the same as it would select these packages from a repository. Since all the dependencies are satisfied with a single command, you will have no dependency issues.

CIsForCookies avatar
us flag
I actually have no "real" dependencies. I only wanted to create the meta package to allow one installation command. With your solution I should be able to skip that meta package, but I'm unsure wildcard is something I want to have
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.