Linux – The following packages have been kept back

debiandebian-wheezylinux

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'

Best Answer

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)

Related Question