The following packages have been kept back

12,757

Solution 1

It's possible to downgrade deb packages to specific repo using apt:

# apt-get install libsmbclient/wheezy libtevent0/wheezy samba/wheezy
  • The "[package]/wheezy" construct means user want package from wheezy repo only and not newest one.
  • It's important to specify all desired packages in one go, so that apt can resolve dependencies correctly and pull other wheezy packages.

If apt doesn't prompt about deleting important packages you want to keep, it's good to go. There shall be a few warnings about dependency problems, but you're safe to ignore those warnings as long as they are not fatal.

After downgrade is successful, the libraries like libtevent0, libldb1 etc are no more needed. You can use apt-get --purge autoremove and/or deborphan (if it's installed) to find and clean orphaned packages not useful on system.

(My previous answer shall be invalidated, will delete soon, it's incorrect anyway -- it's possible to downgrade with apt)

Solution 2

I use the interactive package solver of aptitude:

run sudo aptitude. Then type U (that is capital u) to say you want to upgrade it all. It will tell you that there are conflict, and will make a proposal to solve it. use e to enter the interactive solver, and then . (dot) and , (comma) to iterate over the different solution it will find, then ! to accept one of the solution.

You can also try to help it finding a better solution (for you) by moving to a part of a solution (where for example it propose to remove gnome) and tell it that you want to accept (with A) or refuse (with R) that it does it.

Solution 3

Quickest & Easiest Solution:

You must install each package individually.

See this Superuser solution: apt packages kept back solution

Warning: Do NOT run sudo apt-get dist-upgrade until after you've completely installed the packages that you need installed. AFTER, and ONLY AFTER that, can you run sudo apt-get update & sudo apt-get dist-upgrade

Share:
12,757

Related videos on Youtube

SiliconMind
Author by

SiliconMind

Updated on September 18, 2022

Comments

  • SiliconMind
    SiliconMind almost 2 years

    I'm running 64-bit Debian Wheezy. Recently when I do apt-get upgrade I get this:

    The following packages have been kept back:
      libsmbclient libtevent0 samba-libs
    

    It's driving me crazy. I though I just remove samba as I don't use it anyway but some genius made Gnome depend on it:

    # apt-get remove libsmbclient
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      gnome gnome-core gvfs-backends libgnomevfs2-extra libsmbclient mencoder mplayer
    

    How do I upgrade those packages safely?

    Not much of custom stuff installed:

    deb http://ftp.pl.debian.org/debian/ wheezy main 
    deb-src http://ftp.pl.debian.org/debian/ wheezy main 
    
    deb http://security.debian.org/ wheezy/updates main 
    deb-src http://security.debian.org/ wheezy/updates main 
    
    # wheezy-updates, previously known as 'volatile'
    deb http://ftp.pl.debian.org/debian/ wheezy-updates main 
    deb-src http://ftp.pl.debian.org/debian/ wheezy-updates main 
    
    # wheezy-backports
    deb http://ftp.pl.debian.org/debian/ wheezy-backports main contrib non-free
    
    # virtualbox
    deb http://download.virtualbox.org/virtualbox/debian/ wheezy contrib
    

    [UPDATE]

    What I tried:

    1. apt-get dist-upgrade - result is the same (packages have been kept back).
    2. used aptitude, but all it suggests is to remove gnome and few other gnome related packages and install whole lot of i386 packages (looks like libs only).
    3. apt-get install libsmbclient gives libsmbclient : Depends: samba-libs (= 2:4.1.9+dfsg-1~bpo70+1) but it is not going to be installed
    4. apt-get install libtevent0 gives libtevent0 : Depends: libtalloc2 (>= 2.1.0) but 2.0.7+git20120207-1 is to be installed.
    5. apt-get install samba-libs gives samba-libs : Depends: samba-dsdb-modules (= 2:4.1.9+dfsg-1~bpo70+1) but it is not going to be installed

    [UPDATE 2]

    It seems that the source of this issue lies somewhere in backports repository. I was experimenting with bumblebee and also some DVD ripping stuff once and I remember that I had to install something from backports. I don't need it any more. Bumblebee failed anyway for my hardware and DVD was ripped on Windows in the end :(

    Now I did aptitude search '~S ~i ~Abackports' and got this:

    i   initramfs-tools                   - generic modular initramfs generator
    i A libavutil53                       - Libav utility library
    i   libldb1                           - LDAP-like embedded database - shared library
    i A libnettle4                        - low level cryptographic library (symmetric and one-way cryptos)
    i A libntdb1                          - New Trivial Database - shared library
    i A libopus0                          - Opus codec runtime library
    i   libswscale2                       - Libav video scaling library
    i A libtdb1                           - Trivial Database - shared library
    i A libwbclient0                      - Samba winbind client library
    i A python-talloc                     - hierarchical pool based memory allocator - Python bindings
    i   samba-common                      - common files used by both the Samba server and client
    

    I think that I should downgrade these packages and everything should be fine. Am I right? How should I do that?

    [UPDATE 3]

    I tried to remove or downgrade those packages from backports repo and managed to do it only partially.

    When I wanted to downgrade libntdb1 I realized that it doesn't exist in stable repo. When I tried to remove it - again, apt wanted to remove gnome too. When I did apt-cache rdepends libntdb1 it turned out that only reverse dependency is samba-libs. There is no samba-libs in stable repo too AND I can't remove it either because yet again, it tries to remove gnome and whole lot of stuff. What the hell is going on here? Note that samba-libs is not listed when I do aptitude search '~S ~i ~Abackports'. How to get rid of this thing?

    Also, when I tried to downgrade libldb1 and libwbclient0 I couldn't because apt wanted to remove gnome in both cases. Why?

    So now I ended up with three packages from backports repo listed with aptitude search '~S ~i ~Abackports':

    i   libldb1              - LDAP-like embedded database - shared library
    i A libntdb1             - New Trivial Database - shared library
    i A libwbclient0         - Samba winbind client library
    

    AND samba-libs that apparently also comes from backports but is not listed with aptitude search '~S ~i ~Abackports'

    • Lawrence
      Lawrence almost 10 years
      Why do you need to update those packages ? They're probably being kept back because if you upgrade them, it will break some dependency somewhere else. Also, have you tried apt-get install samba-dsdb-modules ?
    • SiliconMind
      SiliconMind almost 10 years
      @Lawrence Actually I would be happy to just remove them as I don't use samba at all. It seems that one of these packages (or at least one in dependency chain) was accidentally installed from backports repo when I was experimenting with bumblebee :( At least I think so after browsing through aptitude. Maybe it would be good thing to downgrade all packages from backport to current wheezy?
    • SiliconMind
      SiliconMind almost 10 years
      @Lawrence apt-get install samba-dsdb-modules gives: The following packages have unmet dependencies: libdcerpc0, libgensec0, libsamdb0 but it is not going to be installed
    • Lawrence
      Lawrence almost 10 years
      I would just leave it be. There's no real benefit to removing or upgrading those packages.
    • Pablo A
      Pablo A over 4 years
      Does this answer your question? apt says packages have been kept back, what to do? Also on Unix and AskUbuntu
  • SiliconMind
    SiliconMind almost 10 years
    Suggested solution is to remove gnome. This is really dumb. Other options are to remove 153 packages and install 97 new ones - this doesn't look too good.
  • SiliconMind
    SiliconMind almost 10 years
    The packages it suggests to install are all i386
  • SiliconMind
    SiliconMind almost 10 years
    Did that already and it doesn't work. dist-upgrade also throws The following packages have been kept back
  • SiliconMind
    SiliconMind almost 10 years
    This won't work. If I try to do apt-get remove libsmbclient apt wants to also remove gnome and removing gnome means also removing whole lot of stuff. Not the solution I'm looking for.
  • OverCoder
    OverCoder almost 10 years
    @SiliconMind then you simply can't remove it! If you did that manually than gnome wont work as expected, period.
  • OverCoder
    OverCoder almost 10 years
    @SilliconMind you won't be able to remove it as long as gnome depends on it, however you can uninstall gnome and install KDE as a replacement even though it's kind of silly, why do you want to remove that package anyway?
  • SiliconMind
    SiliconMind almost 10 years
    I don't need it, but that's not the point. The point is that I get this stupid kept back thing every time I upgrade my debian. I want this to be resolved to make sure that my system is up to date and not broken.
  • SiliconMind
    SiliconMind almost 10 years
    Should I drop backport repo before or after I downgrade?
  • Abel Cheung
    Abel Cheung almost 10 years
    Doesn't matter because package downgrading doesn't involve using apt.
  • SiliconMind
    SiliconMind almost 10 years
    I tried downgrading those packages but succeeded only partially - please see my last update to the question.
  • Abel Cheung
    Abel Cheung almost 10 years
    @SiliconMind OK, will try to reproduce your environment, and if successful I'll post another answer and delete this one if you won't mind.
  • SiliconMind
    SiliconMind almost 10 years
    I did use apt to downgrade but the problem is that samba-libs and libntdb1 don't exist in current stable repo :(
  • Abel Cheung
    Abel Cheung almost 10 years
    Yes, and you do notice there's no samba-libs and libntdb1 listed in command I listed above, right? The intention is to downgrade all necessary packages from wheezy only, so that those packages from wheezy-backport are orphaned.
  • Femi
    Femi over 9 years
    'apt-get dist-upgrade' did the trick for me.