Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43629

Unable to upgrade Jenkins on Ubuntu 14.04 LTS using 'apt-get upgrade' - The following packages have been kept back

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • packaging
    • None

      We are just now experiencing this issue with upgrades from the official jenkins-ci.org repo. After upgrading one of our staging environments, we moved on our production server, only to find out the jenkins package has been kept back.

      root@deployer-dev:~# apt-get update
      ###
      ### previous/unrelated lines removed for brevity
      ### 
      Ign http://pkg.jenkins-ci.org binary/ InRelease                     
      Hit http://ppa.launchpad.net trusty InRelease                             
      Hit http://pkg.jenkins-ci.org binary/ Release.gpg                          
      Hit http://pkg.jenkins-ci.org binary/ Release                       
      Hit http://pkg.jenkins-ci.org binary/ Packages                     
      Ign http://pkg.jenkins-ci.org binary/ Translation-en_US
      Ign http://pkg.jenkins-ci.org binary/ Translation-en
      Reading package lists... Done
      root@deployer-dev:~# apt-get upgrade
      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      Calculating upgrade... Done
      The following packages have been kept back:
        jenkins
      0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
      

      We've tried several apt-get commands to force the upgrade

      $ apt-get dist-upgrade
      $ apt-get dist-upgrade jenkins
      $ apt-get upgrade jenkins
      $ apt-get install --reinstall jenkins

      ... but the package just won't install. We know that it can be manually and easily be upgraded, but we'd rather use the standard apt-get upgrade process we've always used in the past for consistency.

      The new version is listed, but it won't upgrade.

      root@deployer-dev:~# apt-cache policy jenkins
      jenkins:
        Installed: 2.52
        Candidate: 2.55
        Version table:
           2.55 0
              500 http://pkg.jenkins-ci.org/debian/ binary/ Packages
       *** 2.52 0
              100 /var/lib/dpkg/status
      

      We've also managed to upgrade all other linux packages on this machine, except Jenkins. Some more info about this particular server:

      $ root@deployer-dev:~# lsb_release -a
      No LSB modules are available.
      Distributor ID:    Ubuntu
      Description:    Ubuntu 14.04.5 LTS
      Release:    14.04
      Codename:    trusty
      
      $ uname -a
      Linux deployer-dev 3.13.0-116-generic #163-Ubuntu SMP Fri Mar 31 14:13:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

      Oddly enough, one of our staging environments is running Ubuntu 16.04 LTS, where the upgrade worked normally.

      Would it be possible to provide any clues to resolve this?

      Kind regards.

          [JENKINS-43629] Unable to upgrade Jenkins on Ubuntu 14.04 LTS using 'apt-get upgrade' - The following packages have been kept back

          James Nord added a comment -

          or use --nodeps flag with apt-get and install the JDK manually from Oracle which is certified for Ubuntu 14.04

          James Nord added a comment - or use - -nodeps flag with apt-get and install the JDK manually from Oracle which is certified for Ubuntu 14.04

          Jeroen Bogers added a comment - - edited

          teilo, won't using --nodeps still block the next update of the package (requiring you to always keep using --nodeps)? I cannot find the updating behaviour in the documentation.

          Jeroen Bogers added a comment - - edited teilo , won't using --nodeps still block the next update of the package (requiring you to always keep using --nodeps )? I cannot find the updating behaviour in the documentation.

          James Nord added a comment -

          jbogers yes you will need to keep this whenever you want to upgrade Jenkins. I don;t think apt has a way like YUM to say enable this source repo so would probably kill most future apt upgrades due to incorrect dependencies.

          James Nord added a comment - jbogers yes you will need to keep this whenever you want to upgrade Jenkins. I don;t think apt has a way like YUM to say enable this source repo so would probably kill most future apt upgrades due to incorrect dependencies.

          paladox added a comment -

          Theres an openjdk 8 here https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa for ubuntu.

          paladox added a comment - Theres an openjdk 8 here https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa  for ubuntu.

          Daniel Beck added a comment -

          Is there a reasonable solution for this, other than removing the Java dependency as with all other packages?

          Daniel Beck added a comment - Is there a reasonable solution for this, other than removing the Java dependency as with all other packages?

          I'm trying, but --nodeps does not seem like a possible parameter for apt-get.

          $ apt-get install --nodeps jenkins
          E: Command line option --nodeps is not understood
          $ apt-get install --ignore-missing jenkins
          Reading package lists... Done
          Building dependency tree       
          Reading state information... Done
          The following extra packages will be installed:
            jenkins
          0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
          
          $ apt-get install --reinstall --ignore-missing jenkins
          Reading package lists... Done
          Building dependency tree       
          Reading state information... Done
          The following extra packages will be installed:
            jenkins
          0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

          All of the above have failed.

          $ apt
          apt 1.0.1ubuntu2 for amd64 compiled on Dec  8 2016 16:23:37

          Am I missing something?

          Julio Morimoto added a comment - I'm trying, but --nodeps does not seem like a possible parameter for apt-get. $ apt-get install --nodeps jenkins E: Command line option --nodeps is not understood $ apt-get install --ignore-missing jenkins Reading package lists... Done Building dependency tree        Reading state information... Done The following extra packages will be installed:   jenkins 0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. $ apt-get install --reinstall --ignore-missing jenkins Reading package lists... Done Building dependency tree        Reading state information... Done The following extra packages will be installed:   jenkins 0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. All of the above have failed. $ apt apt 1.0.1ubuntu2 for amd64 compiled on Dec  8 2016 16:23:37 Am I missing something?

          Sam Van Oort added a comment -

          I used to run Ubuntu 14.04 and also hated the fact that it didn't include Java 8 – did the WebUpd8 PPA path as well.  There's also an option to self-package it too – https://github.com/hgomez/obuildfactory/wiki/How-to-build-and-package-OpenJDK-8-on-Linux  .  

          danielbeck I don't think we should be removing the Debian dependency, because that breaks dependency management here for the more recent releases (including 14.10).  

          juliohm Those should work, and I'm not sure why they don't... but you can always go the dpkg --ignore-depends route.

          Sam Van Oort added a comment - I used to run Ubuntu 14.04 and also hated the fact that it didn't include Java 8 – did the WebUpd8 PPA path as well.  There's also an option to self-package it too – https://github.com/hgomez/obuildfactory/wiki/How-to-build-and-package-OpenJDK-8-on-Linux   .   danielbeck I don't think we should be removing the Debian dependency, because that breaks dependency management here for the more recent releases (including 14.10).   juliohm  Those should work, and I'm not sure why they don't... but you can always go the dpkg --ignore-depends route.

          Thanks, svanoort.

          As far as I can tell from this thread, installing Java from the official Oracle PPA would satisfy the dependency, but we don't feel confortable with that. The server we are dealing with is very delicate. Countless jobs for building an deploying on our infrastucture depend on it, and there are several JDK versions and other build tools already installed manually. We're afraid of causing any damage by installing a JDK globally from the ppa.

          I'll leave this issue free from further scrutiny. We are moving forward using Jenkins' internal upgrade mechanism, since we can rely on that from this point forward.

          Kind regards!

          Julio Morimoto added a comment - Thanks, svanoort . As far as I can tell from this thread, installing Java from the official Oracle PPA would satisfy the dependency, but we don't feel confortable with that. The server we are dealing with is very delicate. Countless jobs for building an deploying on our infrastucture depend on it, and there are several JDK versions and other build tools already installed manually. We're afraid of causing any damage by installing a JDK globally from the ppa. I'll leave this issue free from further scrutiny. We are moving forward using Jenkins' internal upgrade mechanism, since we can rely on that from this point forward. Kind regards!

          Oleg Nenashev added a comment -

          We may hit the same for Java 11, moved it to that EPIC for re-review

          Oleg Nenashev added a comment - We may hit the same for Java 11, moved it to that EPIC for re-review

          Mark Waite added a comment -

          Java dependency has been removed from the operating system installers several years ago.

          Mark Waite added a comment - Java dependency has been removed from the operating system installers several years ago.

            Unassigned Unassigned
            juliohm Julio Morimoto
            Votes:
            4 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: