Note: to make this question more concrete I will use the installation of the
rustc package as an example. Nonetheless, the question is intended to apply to packages in general.
I am on a system using Debian Stable. I want to install the
rustc package from the Unstable distribution (it does not exist in Stable, for now). I add the Unstable sources to my
deb http://ftp.debian.org/debian unstable main contrib non-free
deb-src http://ftp.debian.org/debian unstable main contrib non-free
apt update, followed by
apt install rustc. APT refuses to install because of dependency problems, as expected.
The following packages have unmet dependencies:
rustc : Depends: libstd-rust-dev (= 1.12.0+dfsg1-1) but it is not going to be installed
Depends: binutils (>= 2.26) but 2.25-5 is to be installed
Recommends: rust-gdb but it is not going to be installed or
rust-lldb but it is not going to be installed
The only means that occurs to me of installing the package in the repositories is to build it from source. I read this page on Debian wiki, which suggests that a package from Unstable can be build with this procedure:
- add a deb-src line for sid to your sources.list
apt-get build-dep PACKAGE_NAME
apt-get -b source PACKAGE_NAME
But step 3. fails with unmet dependencies.
So my question is if it is possible to build packages from Unstable and installing them in a Stable system. If so, how would it be done? I imagine there must be a way to build/download all dependencies and incorporate them in the final binaries of the package I want. And then install that package.