From 47c539e7aa5892f66b5258160b185fcf7ce4dc42 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Dec 19 2020 01:01:41 +0000 Subject: Document how to skip installing weak dependencies This is actually possible with `--setopt=install_weak_deps=False`, contrary to the existing documentation. Tested on Fedora 33 with `fennel`: ``` ~ ❯ sudo dnf install fennel Last metadata expiration check: 0:01:01 ago on Fri 18 Dec 2020 04:51:33 PM PST. Dependencies resolved. ============================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================== Installing: fennel noarch 0.7.0-2.fc33 updates 79 k Installing weak dependencies: lua-readline x86_64 2.7-1.fc33 updates 23 k Transaction Summary ============================================================================================================================================================================== Install 2 Packages Total download size: 102 k Installed size: 444 k Is this ok [y/N]: n Operation aborted. ~ took 6s ❯ sudo dnf --setopt=install_weak_deps=False install fennel Last metadata expiration check: 0:01:36 ago on Fri 18 Dec 2020 04:51:33 PM PST. Dependencies resolved. ============================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================== Installing: fennel noarch 0.7.0-2.fc33 updates 79 k Transaction Summary ============================================================================================================================================================================== Install 1 Package Total download size: 79 k Installed size: 388 k Is this ok [y/N]: n Operation aborted. ~ took 6s ❯ sudo dnf install fennel -y Last metadata expiration check: 0:02:18 ago on Fri 18 Dec 2020 04:51:33 PM PST. Dependencies resolved. ============================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================== Installing: fennel noarch 0.7.0-2.fc33 updates 79 k Installing weak dependencies: lua-readline x86_64 2.7-1.fc33 updates 23 k Transaction Summary ============================================================================================================================================================================== Install 2 Packages Total download size: 102 k Installed size: 444 k Downloading Packages: (1/2): fennel-0.7.0-2.fc33.noarch.rpm 180 kB/s | 79 kB 00:00 (2/2): lua-readline-2.7-1.fc33.x86_64.rpm 49 kB/s | 23 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 118 kB/s | 102 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : lua-readline-2.7-1.fc33.x86_64 1/2 Installing : fennel-0.7.0-2.fc33.noarch 2/2 Running scriptlet: fennel-0.7.0-2.fc33.noarch 2/2 Verifying : fennel-0.7.0-2.fc33.noarch 1/2 Verifying : lua-readline-2.7-1.fc33.x86_64 2/2 Installed: fennel-0.7.0-2.fc33.noarch lua-readline-2.7-1.fc33.x86_64 Complete! ~ took 6s ❯ sudo dnf remove lua-readline Dependencies resolved. ============================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================== Removing: lua-readline x86_64 2.7-1.fc33 @updates 56 k Transaction Summary ============================================================================================================================================================================== Remove 1 Package Freed space: 56 k Is this ok [y/N]: n Operation aborted. ``` Signed-off-by: Michel Alexandre Salim --- diff --git a/guidelines/modules/ROOT/pages/WeakDependencies.adoc b/guidelines/modules/ROOT/pages/WeakDependencies.adoc index 31c0b85..6c88b5d 100644 --- a/guidelines/modules/ROOT/pages/WeakDependencies.adoc +++ b/guidelines/modules/ROOT/pages/WeakDependencies.adoc @@ -27,8 +27,8 @@ Weak dependencies are by default treated similarly to regular `+Requires:+`. Matching packages are added to the dnf transaction. If adding the package would lead to an error dnf will by default ignore the dependency. This allows users to exclude packages that would be added by weak -dependencies or remove them later. (Future versions of dnf might also allow to -switch weak deps off on the command line.) +dependencies or remove them later. To skip installing weak dependencies, pass +`--setopt=install_weak_deps=False` to `dnf`. As with regular dependencies, weak dependencies MUST be satisfiable within the official Fedora repositories.