For each entry (stable, testing, unstable) you have pin-priority 500. You shouldn't use pin > 1000. I use 1001 only when I want to downgrade something. I have testing+sid+experimental entries specified in /etc/apt/sources.list
and the following /etc/apt/preferences
file:
Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 900
Package: *
Pin: release o=Debian,a=experimental
Pin-Priority: 130
The value 500 is default for unstable. So, let's try to check iceweasel:
# apt-cache policy iceweasel
iceweasel:
Installed: (none)
Candidate: 17.0.10esr-1~deb7u1
Version table:
26.0-1 0
130 http://ftp.pl.debian.org/debian/ experimental/main amd64 Packages
24.2.0esr-1 0
500 http://ftp.pl.debian.org/debian/ sid/main amd64 Packages
17.0.10esr-1~deb7u1 0
900 http://ftp.pl.debian.org/debian/ testing/main amd64 Packages
So, if I tried to install iceweasel, it would be downloaded from the testing branch because it has the highest priority.
Try to change the priorities to:
Package: *
Pin: release a=wheezy
Pin-Priority: 900
Package: kpcli
Pin: release a=jessie
Pin-Priority: 910
Reverse depends
Reverse depends means you want a list of packages that depend on a given package.
Example
$ apt-cache rdepends jetty
jetty
Reverse Depends:
solr-jetty
libjetty-java
libjetty-extra-java
libjetty-extra
libini4j-java
guacamole
Recursive depends
Using a tool such as apt-rdepends
shows what packages a given package is dependent on, plus what packages these packages are also dependent on. This is performed recursively until the entire dependency tree is exhausted.
Example
$ apt-rdepends jetty | head -10
Reading package lists... Done
Building dependency tree
Reading state information... Done
jetty
Depends: adduser
Depends: apache2-utils
Depends: default-jre-headless
Depends: java5-runtime-headless
Depends: jsvc
Depends: libjetty-java (>= 6.1.26-1ubuntu1)
adduser
Depends: debconf
Depends: debconf-2.0
...
Above you can see that jetty
is dependent on adduser
which itself is dependent on debconf
.
Reverse recursive depends
This one shows what packages depend on a package that depends on a given package. This is again done recursively.
Example
$ apt-rdepends --reverse jetty
Reading package lists... Done
Building dependency tree
Reading state information... Done
jetty
Reverse Depends: solr-jetty (>= 3.6.1+dfsg-0ubuntu2)
solr-jetty
Reverse Depends: chef-solr (>= 10.12.0+dfsg-1)
chef-solr
Reverse Depends: chef-expander (>= 10.12.0-1)
Reverse Depends: chef-server-api (>= 10.12.0-1)
chef-expander
chef-server-api
Reverse Depends: chef-server-webui (>= 10.12.0+dfsg-1)
chef-server-webui
Again here as the tree is explored the first package that lists jetty
as a dependency is solr-jetty
, which in turn is listed as a dependency for chef-solr
, etc.
Types of depends
It can get a little confusing but there are a variety of depends. Looking at the man page for apt-rdepends
:
-f, --follow=DEPENDS
A comma-separated list of DEPENDS types to follow recursively.
By default, it only follows the Depends and PreDepends types.
The possible values for DEPENDS are: Depends, PreDepends, Suggests,
Recommends, Conflicts, Replaces, and Obsoletes.
In --build-depends mode, the possible values are: Build-Depends,
Build-Depends-Indep, Build-Conflicts, Build-Conflicts-Indep.
Best Answer
APT doesn't know anything about software that was installed manually. It doesn't know what libraries that software needs or anything.
When APT installs a package only to fulfill the dependencies of another package, this package is marked as automatically installed. If you remove all the packages that depend on an automatically-installed package, that package is removed when you run
apt-get autoremove
; higher-level frontends to APT will typically offer to do that after other maintenance. To avoid removing packages that are needed by locally-installed software, mark these packages as manually installed:apt-mark manual PACKAGE-NAME
, or them
key in aptitude.To find what library packages a binary executable needs, run
ldd /path/to/executable
. For each line containing/usr/lib/SOMETHING
, rundpkg -S /usr/lib/SOMETHING
to display the name of the package containing that library. For scripts,head -n 1 /path/to/script
shows the interpreter used by the script; make sure that this interpreter remains installed. Finding what libraries are used by a script can be difficult, there's no universal way to do that.If you've manually installed a more recent version of a package that's present in your distribution, look at the dependencies of the distribution's package and mark them as manually installed.