1

I think, this question is about the same problem. That question is marked as answered, although the problem isn't solved, so I open a new question with little bit more details.

Short description:

apt can't upgrade a package if some dependencies are missing (it's OK), but what I observe on ubuntu 14.04 is that it does so with exit code 0 (issue 1) and without reporting 'unmet dependencies' (issue 2).

Detailed description:

I'm on Ubuntu 14.04, apt version 1.0.1ubuntu2.6

# uname -a       
Linux myhost 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

# lsb_release -c      
Codename:       trusty

# dpkg -l apt         
||/ Name            Version        Architecture Description
+++-===============-==============-============-====================================
ii  apt             1.0.1ubuntu2.6 amd64        commandline package manager

I have a package installed, version 0.03, no dependencies:

# dpkg -l fake-test-package
||/ Name                  Version         Architecture    Description
+++-=====================-===============-===============-===============================================
ii  fake-test-package     0.03-1          all             package to test apt

# apt-cache depends fake-test-package=0.03-1
fake-test-package

I'd like to upgrade the package to the version 0.04 (which has unmet dependency very-strange-dependency):

# apt-cache depends fake-test-package=0.04-1
fake-test-package
  Depends: <very-strange-dependency>

So, I perform apt-get install:

# apt-get install fake-test-package=0.04-1         
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  fake-test-package
0 upgraded, 0 newly installed, 0 to remove and 217 not upgraded.

# echo $?
0

Everything seems OK, and the exit code is 0, but the packages wasn't updated:

# dpkg -l fake-test-package
||/ Name                  Version         Architecture    Description
+++-=====================-===============-===============-===============================================
ii  fake-test-package     0.03-1          all             package to test apt

Here is the problem, as apt silently refuses to upgrade the package and I don't know neither that it happened nor why.

On Ubuntu 12.04 I observe the different behavior: exit code=100 and 'unmet dependencies' report:

precise# apt-get install fake-test-package=0.04-1
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:
 fake-test-package : Depends: very-strange-dependency but it is not installable
E: Unable to correct problems, you have held broken packages.

precise# echo $?
100

What is interesting, the problem occurs only on upgrade of existing package. If I remove version 0.03 from the system and try to install 0.04 directly, apt behaves in an expected way:

trusty# apt-get purge fake-test-package
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  fake-test-package*
0 upgraded, 0 newly installed, 1 to remove and 217 not upgraded.
After this operation, 13.3 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 157742 files and directories currently installed.)
Removing fake-test-package (0.03-1) ...
Purging configuration files for fake-test-package (0.03-1) ...

trusty# apt-get install fake-test-package=0.04-1
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:
 fake-test-package : Depends: very-strange-dependency but it is not installable
E: Unable to correct problems, you have held broken packages.

trusty# echo $?
100 

The question:

How can I make apt to report unmet dependencies on upgrade of an installed package and to show failed upgrade via non-zero exit code?

1 Answer 1

0

This seems to be a bug of apt. Version 1.0.1 is affected.

We've built version 1.0.9.2 from source, and it behaves as expected: reports unmet dependencies and exits with non-zero status.

Perhaps this is the same bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745046

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .