Skip to content
This repository was archived by the owner on Dec 27, 2021. It is now read-only.
This repository was archived by the owner on Dec 27, 2021. It is now read-only.

ensure package something does not install the package #139

@jbzdak

Description

@jbzdak

Hi!

Sometimes AptitudeRole.ensure_package does not work as intended. This due to aptitudes behaviour, if it can't install packages because of dependency resolution errors it exits with 0 status, and provy thinks all is OK.

Example:

root@debian:~# aptitude install -y python3.3
The following NEW packages will be installed:
  libpython3.3-minimal{ab} libpython3.3-stdlib{ab} python3.3 python3.3-minimal{ab} 
0 packages upgraded, 4 newly installed, 0 to remove and 36 not upgraded.
Need to get 4,044 kB of archives. After unpacking 16.8 MB will be used.
The following packages have unmet dependencies:
 libpython3.3-minimal : Depends: libc6 (>= 2.14) but 2.13-38 is installed.
 python3.3-minimal : PreDepends: libc6 (>= 2.15) but 2.13-38 is installed.
 libpython3.3-stdlib : Depends: libc6 (>= 2.15) but 2.13-38 is installed.
                       Depends: libffi6 (>= 3.0.4) but it is not going to be installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libpython3.3-minimal [Not Installed]               
2)     libpython3.3-stdlib [Not Installed]                
3)     python3.3 [Not Installed]                          
4)     python3.3-minimal [Not Installed]                  

     Leave the following dependencies unresolved:         
5)     python3.3-minimal recommends python3.3             


No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.                                  c
root@debian:~# echo $?
0

Apt get on the other hand returns other error:

root@debian:~# apt-get install -y python3.3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3.3 : Depends: python3.3-minimal (= 3.3.3-4) but it is not going to be installed
             Depends: libpython3.3-stdlib (= 3.3.3-4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@debian:~# echo $?
100

Possible solutions:

  • Use apt-get instead of aptitude
  • After each install manually check using: is_package_installed whether aptitude succeeded.

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions