Bug 12964

Summary: Support 'don't install this package' option during install
Product: [Yocto Project Subprojects] opkg Reporter: Ross Burton <ross.burton>
Component: opkgAssignee: Alejandro del Castillo <alejandro.delcastillo>
Status: RESOLVED WORKSFORME QA Contact:
Severity: enhancement    
Priority: Undecided    
Version: 0.3.6   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2018-10-17 10:00:47 UTC
dnf supports -x to exclude packages from the operation.  For example during a rootfs construction:

$ dnf install rpm -x python3-core
[...]
Error:
 Problem 1: conflicting requests
  - nothing provides python3-core needed by dnf-2.7.5-r0.corei7_64
 Problem 2: conflicting requests
  - nothing provides python3-core needed by rpm-1:4.14.2-r0.corei7_64

The same can be done with dpkg by using pins and setting a -1 priority.

Can something similar be added to opkg?
Comment 1 Alejandro del Castillo 2018-10-17 16:36:58 UTC
Opkg already has a flag to do that (--add-exclude). In the following example, a DEPENDS on b:

[adelcast@delcastillo3 tests]$ opkg -o /tmp/opkg --add-exclude b install a

Collected errors:
 * Solver encountered 1 problem(s):
 * Problem 1/1:
 *   - nothing provides b needed by a-1.0.all
 * 
 * Solution 1:
 *   - do not ask to install a package providing a

[adelcast@delcastillo3 tests]$ opkg -o /tmp/opkg install a
Installing b (1.0) on root
Downloading file:/tmp/opk/b_1.0_all.opk.
Installing a (1.0) on root
Downloading file:/tmp/opk/a_1.0_all.opk.
Comment 2 Ross Burton 2018-10-17 16:39:48 UTC
I looked at the source and everything to verify it didn't exist before filing this...  :(