Install package from oldstable (wheezy) to stable (jessie)
I want to install the package which is missing in jessie from wheezy. It is like backport the other way. I need gcc-4.7, but jessie provides only gcc-4.9. Unstable provides gcc-4.7 only for arm architecture. I plan to add wheezy repo into my surces and install it with command
apt install gcc-4.7/wheezy
Is it relatively safe to do it? Do I risk dependency problems doing this?
Most likely it is not going to work flawlessly. Usually paths and binaries from older versions conflict with the new ones. Sometimes somebody backports it and when they do, it usually involves changing paths to get all working under non-standard directories. This makes the package work but no other package will find their dependencies.
One thing that you might want to try is to make the affected executable run in a docker container. You can create a container of a previous Debian version, install there the minimal software needed to run your executable and then create an image of the container. All the dependencies will be inside the container and you can simply run it with docker run <image> <command>
. This can save the day for some command line software, even for server software but coud be a mess if the affected executable needs Xserver or administrative privileges.
You could try recompiling the source deb package you get from wheezy, on your jessie instance. Please note that I'm assuming gcc-4.7
can be compiled without errors using gcc-4.9
, which is not a sure bet.
However the general procedure should be:
- Add wheezy binaries as source to your
/etc/apt/sources.list
file, such asdeb http://ftp.us.debian.org/debian/ wheezy main contrib
- Add wheezy sources as source to your
/etc/apt/sources.list
file, such asdeb-src http://ftp.us.debian.org/debian/ wheezy main contrib
- run
apt-get update
- download the
gcc-4.7
source package:apt-get source gcc-4.7
- install
gcc-4.7
build-dependencies by runningapt-get build-dep gcc-4.7
(this can be quite hard actually, because there might be a number of conflicts with your currently installed packages and you need to sort them out manually) - enter the directory where
apt-get
downloadedgcc-4.7
source package in step 4, e.g.cd gcc-4.7
or whatever it is called - build gcc-4.7:
dpkg-buildpackage -us -uc
- assuming it builds without errors, install the generated packages you'll find in the parent directory
I've written this procedure going by memory, so please take it with a grain of salt and adjust commands where needed. In particular I'm not sure dpkg-buildpackage
-us
and -uc
options existed in jessie, if they didn't just don't use them.