Bug in apt-get ? [replace essential package / Yes, do as I say]
Before I file a bugreport I thought I'd ask here first ..
It seems that currently apt is not able to replace an essential
package. Well in fact the package I am trying to replace isn't
even really essential...
Sysvinit was split up in sysvinit, initscripts and sysv-rc. The last
one can be replaced by file-rc. Sysv-rc and file-rc conflict and
replace one another.
File-rc and sysv-rc are not Essential, but sysvinit depends on
(sysv-rc | file-rc) so they are 'virtually essential'. However that
doesn't matter as policy says:
If set to yes then dpkg and dselect will refuse to remove the package
(though it can be upgraded and/or replaced).
Dpkg gets it right. I can replace sysv-rc with file-rc :
# dpkg -i file-rc_0.8.0_all.deb
Selecting previously deselected package file-rc.
dpkg: considering removing sysv-rc in favour of file-rc ...
dpkg: yes, will remove sysv-rc in favour of file-rc.
(Reading database ... 39148 files and directories currently installed.)
Unpacking file-rc (from file-rc_0.8.0_all.deb) ...
Setting up file-rc (0.8.0) ...
However, apt wants to do this in two passes. First it wants to remove
sysv-rc, then it wants to install file-rc. It internally upgrades
sysv-rc to Essential because sysvinit is essential, and then refuses
to do the upgrade:
# apt-get install file-rc
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
The following NEW packages will be installed:
WARNING: The following essential packages will be removed
This should NOT be done unless you know exactly what you are doing!
sysv-rc (due to sysvinit)
0 packages upgraded, 1 newly installed, 1 to remove and 31 not upgraded.
Need to get 0B/33.1kB of archives. After unpacking 127kB will be used.
You are about to do something potentially harmful
To continue type in the phrase 'Yes, do as I say!'
If you type 'Yes, do as I say!' apt will run dpkg twice: one to remove
sysv-rc, then once again to install file-rc.
I even tried to install a file-rc package that has 'Provides: sysv-rc'
in the control file but that doesn't help either.
I do not want to remove sysv-rc, I'm replacing it. Is this a bug in
apt ? And, why is apt splitting the operation into two steps ?