n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Possible to break dependencies? I.e., Install a package w/o its dependencies?

Wed Nov 07, 2018 11:13 pm

I know you're "not supposed to" do this, but I think there needs to be an override.

The specific case: I want to install the "at" command. "at" is a very useful Unix tool which is standard, old-school Unix. It is kind of like an "immediate" version of "cron". To my mind, if "cron" is installed, then so too should "at" be, but the makers of Raspbian obviously think otherwise. For whatever reason(s), "cron" is installed by default, but 'at" is not. In the past, on other versions of Raspbian, I've been able to "apt install at".

However, now, when I just tried it, it wanted to install a whole bunch of other, er, stuff. Specifically, bsd-mail and all the related stuff. On the surface, this makes sense, since Raspbian does not include the mail transport stuff by default (either the client end or the server end) and, it is true that in order to make good use of "at", you'll want email to be setup and working. Of course, this same argument applies to "cron", and, yes, "cron" is a little hard to use until you have the mail situation sorted out, but, then again, they include "cron" in the default setup (without mail and friends).

Anyway, that all said, the situation is that I don't need the mail stuff - I know how to handle "at" and "cron" without a normal mail setup. I just want to install "at". Is there a way to do that, using the normal "apt" and/or "apt-get" infrastructure?

The normal workaround would be to download "at" in source and then compile that.

Or, I think it is also possible to download the compiled program without installing it.

But, anyway, I'm asking this from a more general POV. In general, is there an override that would allow me to just get the package I want installed, without the dependencies?

I think I knew how to do this at one time, but I seem to have forgotten...
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
Imperf3kt
Posts: 2541
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 12:15 am

Just as you Pi is dependant on electricity to function, the program you wish to install is dependant on its dependencies.

It makes use of them, without which it will not function.
If those packages were optional, they'd probably be called "optionalies"
55:55:44:44:4C
52:4C:52:42:41

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 1:28 am

False.

That's how it is supposed to work, but sometimes, as in this case, it simply 'taint true.

If you read carefully, you will see that.

As I say, there needs to be an override. But I fear there isn't.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

plugwash
Forum Moderator
Forum Moderator
Posts: 3433
Joined: Wed Dec 28, 2011 11:45 pm

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 2:31 am

The debian packaging system gets most unhappy when dependencies are unsatisfied.

So you basically have two options.

1. Build a dummy package that satisfies the dependency without really providing the service in question
2. Rebuild the package with the dependency to remove it.

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 2:43 am

Yeah, that's kinda what I thought was going to be the case.

It's kinda like the situation with "Foreign Keys" in databases - It always seemed to me that there should be an override, but the gods of database say otherwise.

P.S. Both of the solutions you propose are beyond my pay grade. I think I will have to go the "build from source" route. That I know how to do...
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

code_exec
Posts: 271
Joined: Sun Sep 30, 2018 12:25 pm

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 6:04 am

I really am not convinced that a basic command requires a mail client to function properly.

You could try adding "--no-install-recommends" to the end of the installation command, since they may just be recommended packages that are installed by default with that package.

If apt still insists that these packages are installed, then you have no other option other than to let it install the dependencies as well.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.

https://github.com/CodeExecution/Ubuntu-ARM64-RPi

User avatar
rpdom
Posts: 14709
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 6:13 am

code_exec wrote:
Thu Nov 08, 2018 6:04 am
You could try adding "--no-install-recommends" to the end of the installation command, since they may just be recommended packages that are installed by default with that package.
They are. I just checked this and it only selected the "at" package.

I usually have the no-install-recommends option hard-coded into a config file to prevent all the "recommended" stuff being installed. I've only had an issue with that once.

Code: Select all

[email protected]:~ $ cat /etc/apt/apt.conf.d/90-local 
APT::Install-Recommends "false";

[email protected]:~ $ apt-get -s install at
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  default-mta | mail-transport-agent
The following NEW packages will be installed:
  at
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst at (3.1.20-3 Raspbian:stable [armhf])
Conf at (3.1.20-3 Raspbian:stable [armhf])

code_exec
Posts: 271
Joined: Sun Sep 30, 2018 12:25 pm

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 6:35 am

rpdom is right.

When I ran "apt install at", with no extra arguments at the end, it wanted to install several irrelevant packages.

Code: Select all

[email protected]:~ $ sudo apt install at
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  exim4-base exim4-config exim4-daemon-light guile-2.0-libs libgc1c2 libgsasl7
  libkyotocabinet16v5 libmailutils5 libmariadbclient18 libntlm0 mailutils
  mailutils-common mysql-common
Suggested packages:
  eximon4 exim4-doc-html | exim4-doc-info spf-tools-perl swaks mailutils-mh
  mailutils-doc
The following NEW packages will be installed:
  at exim4-base exim4-config exim4-daemon-light guile-2.0-libs libgc1c2
  libgsasl7 libkyotocabinet16v5 libmailutils5 libmariadbclient18 libntlm0
  mailutils mailutils-common mysql-common
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,514 kB of archives.
After this operation, 25.4 MB of additional disk space will be used.
When I ran "apt install at" with the "--no-install-recommends" argument at the end, it didn't want to install any extra packages.

Code: Select all

[email protected]:~ $ sudo apt install at --no-install-recommends
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  default-mta | mail-transport-agent
The following NEW packages will be installed:
  at
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 44.4 kB of archives.
After this operation, 130 kB of additional disk space will be used.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.

https://github.com/CodeExecution/Ubuntu-ARM64-RPi

User avatar
rpdom
Posts: 14709
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 7:36 am

code_exec wrote:
Thu Nov 08, 2018 6:35 am
When I ran "apt install at" with the "--no-install-recommends" argument at the end, it didn't want to install any extra packages.
Some time ago, the default in Debian (which is what Raspbian is heavily based on), was to not install the "recommended" extra packages. That was changed because some people found things that didn't work without them. Now the default is to install "recommended" as well as the essential "depends", but fortunately not the "suggested" options.

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 7:40 am

OK, that does seem to fix this specific problem (at).

However, it still leaves the general question unanswered.

(That's the problem with giving specifics of a problem. The help-givers focus on solving the specific problem, and lose sight of the real point. For this reason, I usually avoid giving specific instances. People focus on the wrong things...)

Comments:
1) I think there's actually a configuration option to tell apt/apt-get not to bother with "recommended" packages. I should look into that.
2) It would be nice if it prompted at runtime whether or not you want to install the recommends. I.e., at the point where it asks Y/n to continue, there should be a few more options.
3) Even though in this case, it turned out only to be a recommendation, there have been other times in the past where it had a hard dependency and I've wanted an override.

P.S. As I was posting, rpdom slipped in. Yes, I think I'm more used to the old behavior. That's why this one caught me by surprise, and I assumed that the mail stuff was a dependency, not just a recommends.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
rpdom
Posts: 14709
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Possible to break dependencies? I.e., Install a package w/o its dependencies?

Thu Nov 08, 2018 8:20 am

n67 wrote:
Thu Nov 08, 2018 7:40 am
1) I think there's actually a configuration option to tell apt/apt-get not to bother with "recommended" packages. I should look into that.
There is. I thought I posted it. [edit]Yes, I did, Up there ^ somewhere[/edit]

Create a file in /etc/apt/apt.conf.d called something like 99local or 99norecommends with these contents

Code: Select all

APT::Install-Recommends "false";

Return to “Raspbian”