At the moment, when I do apt-get dist-upgrade on my Raspbian it prompts me to throw out upstart again and install sysvinit. I don't get the same with apt-get upgrade.
However, I find the behavior of dist-upgrade more desirable in general, just not in this specific case.
I use apt-get most of the time and dpkg every once in a while. I don't use aptitude or any of the other front-ends.
What would be the proper method to tell apt-get that I want to keep any version of upstart over any version of sysvinit? Will this work, or will it screw up something else in the process?:
Package: sysvinit
Pin: version *
Pin-Priority: -1
Is pinning (apt_preferences(5)) the way to go - and if so how - or do I have to tell one of the many package management tools to "hold" the package some other way? This is somewhat related to the as of yet unanswered (at least not in a meaningful way) question here.
The following will at least shut up apt-get dist-upgrade, but will it perhaps mess up something in future? There are numerous explicit warnings in apt_preferences(5) about how much things can be messed up by pinning.
- Create a file
/etc/apt/preferences.d/prefer-upstart-over-sysvinit.pref. - Fill in the contents produced below this list.
- Run
apt-get update && apt-get dist-upgrade.
File contents:
Package: sysvinit
Pin: version *
Pin-Priority: -1
Package: upstart
Pin: version *
Pin-Priority: 1001
According to the man page this should yield the desired result.
P >= 1000
causes a version to be installed even if this constitutes a
downgrade of the package
990 <= P < 1000
causes a version to be installed even if it does not come
from the target release, unless the installed version is
more recent
500 <= P < 990
causes a version to be installed unless there is a version
available belonging to the target release or the installed
version is more recent
100 <= P < 500
causes a version to be installed unless there is a version
available belonging to some other distribution or the
installed version is more recent
0 < P < 100
causes a version to be installed only if there is no
installed version of the package
P < 0
prevents the version from being installed
The confusing part is whether this is the proper method and why the entry only for sysvinit (with priority -1) didn't work out.
# apt-cache policy sysvinit upstart
sysvinit:
Installed: (none)
Candidate: 2.88dsf-41+deb7u1
Version table:
2.88dsf-41+deb7u1 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
upstart:
Installed: 1.6.1-1
Candidate: 1.6.1-1
Version table:
*** 1.6.1-1 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
100 /var/lib/dpkg/status
# apt-get install sysvinit
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libjson0
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
upstart
The following NEW packages will be installed:
sysvinit
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 129 kB of archives.
After this operation, 940 kB disk space will be freed.
Do you want to continue [Y/n]?