0

For instance, say hypothetically (or in reality) one was using and needed to continue using Debian Jessie, but wanted to utilize PHP7 from Debian Stretch. They might edit /etc/apt/sources.list to use Stretch and install the new software and then revert /etc/apt/sources.list back to Jessie. But would they also need to do the same for nginx or other packages? If so, how would they know? And would they wish to perform an apt-get update during the time they were configured to use Stretch?

user1032531
  • 1,897
  • 6
  • 31
  • 36

1 Answers1

3

Here’s what to look out for when mixing stable releases: don’t.

What’s more, adding a different release to sources.list temporarily is a really bad idea, because you won’t get any updates to the packages you pull in from that different release. If you really do want to go down this route, set up pinning properly and enable the new release permanently.

However, I’ll say it again: don’t do this. If you want PHP 7 from Debian 9, upgrade to Debian 9, or request a proper backport to Debian 8 (and accept that the answer might well be “no”).

Regarding your specific questions, if other packages need to be upgraded, apt & co. will tell you. You need to run apt update after changing sources.list for the changes to take effect; if you’re referring to apt upgrade, if you run that with Debian 9 in your repositories and no pinning, you’ll upgrade to Debian 9 as far as possible without deleting packages (you’d need dist-upgrade for a full upgrade).

Stephen Kitt
  • 434,908
  • Yikes. Did the deed before going to bed, then read your answer. Think I made a mistake. Not that I don't believe you, but what are the implications? Edited /etc/apt/sources.list to use Stretch, executed sudo apt-get update && sudo apt-get install nginx sqlite3 php7.0 php7.0-common php7.0-curl php7.0-fpm php7.0-cli php7.0-opcache php7.0-sqlite3, then reverted back to Jessie, and executed sudo apt-get update && sudo apt-get dist-upgrade (where the later showed zero changes as I had hoped). I hear you saying even pinning is not ideal, right? Maybe I should just install from source? – user1032531 Dec 08 '17 at 11:59
  • Now that you’ve installed everything, and it all went well, I’d recommend keeping things as-is; but keep an eye on the package updates in Stretch and upgrade manually if necessary. – Stephen Kitt Dec 08 '17 at 13:26
  • Oh and pinning can be OK. The basic rule is that mixing releases is potential dangerous, or at least can create problems; so ideally you need to know what you’re doing before attempting it. What you could do is add Stretch and pin it very low; you can check the settings with apt-cache policy (with no other arguments). That way if updates are released for php7.0, nginx or sqlite3, or their Stretch-based dependencies, you’ll get them, but you won’t get anything else. – Stephen Kitt Dec 08 '17 at 13:29
  • Guess I need to read up on pinning! Thanks for the help. – user1032531 Dec 08 '17 at 14:41
  • @user1032531 To add to what Stephen said, it's often possibly, and usually not too difficult, to do a backport oneself. See http://unix.stackexchange.com/q/112157/4671 – Faheem Mitha Dec 18 '17 at 08:45