1

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.

  1. Create a file /etc/apt/preferences.d/prefer-upstart-over-sysvinit.pref.
  2. Fill in the contents produced below this list.
  3. 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]?
0xC0000022L
  • 16,189
  • 24
  • 102
  • 168
  • What release are you using? What's the output of `apt-cache policy sysvinit upstart`? Is `sysvinit` up-to-date and does `apt-get install sysvinit` do anything interesting? – Gilles 'SO- stop being evil' Nov 16 '13 at 21:45
  • @Gilles: pasted it into my question. – 0xC0000022L Nov 17 '13 at 00:09
  • Oops, sorry, I meant does `apt-get install upstart` do anything interesting? You shouldn't have to mess up with preferences, maybe the packages are buggy. Oh, wait, googling found something… – Gilles 'SO- stop being evil' Nov 17 '13 at 22:11
  • @Gilles: thanks, it's possibly a duplicate, but `aptitude` is a bad idea. Never mix the different package management frontends or expect the wrath of the Debian deities. Moo! ... – 0xC0000022L Nov 18 '13 at 00:21
  • There's nothing wrong with mixing aptitude with apt-get. Whatever gave you this idea? – Gilles 'SO- stop being evil' Nov 18 '13 at 00:25
  • @Gilles: they have different dependency-resolution algorithms and although this cautious behavior on my part may stem from a few years ago, several Debian releases back, it served me well, while mixing it back in those days burned me twice or thrice. So to answer your question: experience gave me that idea. And whether bug or not bug is irrelevant if I need my system to work reliably. So I stick my my rule of thumb ;) – 0xC0000022L Nov 18 '13 at 00:27

0 Answers0