** Description changed:
- In a fresh 20.04 lxc/chroot install, then remove chrony:
+ [Impact]
+
+ * I was cherry-picking a fix we needed due to the recent systemd
+changes to timesyncd. There was also a fix-of-the-fix a bit later which
+is missing and therefore breaking package removal.
+
+ * The fix is as simple as adding the "remove" target to the case statement
+on the empty target and thereby avoiding breakage.
+
+ [Test Case]
+
+ * apt install chrony
+ * apt install systemd-timesyncd
+# this should list and work:
+The following packages will be REMOVED:
+ chrony
+ * apt install chrony
+ * apt remove chrony
- # apt install chrony
- ...
- # apt install systemd-timesyncd
+ [Regression Potential]
+
+ * It is a silly bug due to cherry picking a fix without the fix-of-the-
+fix. I honestly see no regression due to re-adding "remove" target.
+
+ [Other Info]
+
+ * This does not necessarily have to be on the -release. Nothing to stop
+generating the ISO at least. But I'd appreciate if we could accept it
+into -proposed asap to hopefully (if we rebuild once) pick it up.
+The reason is that I haven't seen reports, but can think of odd
+dependency chains like
+ 1. install chrony (will remove systemd-timesyncd)
+ 2. remove chrony fails
+ 3. but installing systemd-timesyncd fails as well
+It can be hard to get this resolved and the change is small.
+So I'd appreciate if we could avoid it completely.
+
+ root@f:~# apt install systemd-timesyncd
Reading package lists... Done
- uilding dependency tree
+ Building dependency tree
Reading state information... Done
- The following package was automatically installed and is no longer required:
- libfreetype6
- Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
chrony
The following NEW packages will be installed:
systemd-timesyncd
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
- Need to get 27.9 kB of archives.
+ 1 not fully installed or removed.
+ Need to get 0 B/27.9 kB of archives.
After this operation, 290 kB disk space will be freed.
- Do you want to continue? [Y/n]
- Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 systemd-timesyncd
amd64 245.4-4ubuntu1 [27.9 kB]
- Fetched 27.9 kB in 0s (951 kB/s)
+ Do you want to continue? [Y/n] Y
dpkg: chrony: dependency problems, but removing anyway as you requested:
systemd depends on systemd-timesyncd | time-daemon; however:
Package systemd-timesyncd is not installed.
Package time-daemon is not installed.
Package systemd-timesyncd which provides time-daemon is not installed.
Package chrony which provides time-daemon is to be removed.
- (Reading database ... 31279 files and directories currently installed.)
+ (Reading database ... 83798 files and directories currently installed.)
Removing chrony (3.5-6ubuntu5) ...
postrm called with unknown argument `remove'
dpkg: error processing package chrony (--remove):
installed chrony package post-removal script subprocess returned error exit
status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
chrony
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
- root@ff-chrony:~# history
- 1 apt install chrony
- 2 apt install systemd-timesyncd
- 3 history
+
+
+ ---
+
+
+ In a fresh 20.04 lxc/chroot install, then remove chrony:
+
+ # apt install chrony
+ ...
+ # apt install systemd-timesyncd
+ Reading package lists... Done
+ uilding dependency tree
+ Reading state information... Done
+ The following package was automatically installed and is no longer required:
+ libfreetype6
+ Use 'apt autoremove' to remove it.
+ The following packages will be REMOVED:
+ chrony
+ The following NEW packages will be installed:
+ systemd-timesyncd
+ 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+ Need to get 27.9 kB of archives.
+ After this operation, 290 kB disk space will be freed.
+ Do you want to continue? [Y/n]
+ Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 systemd-timesyncd
amd64 245.4-4ubuntu1 [27.9 kB]
+ Fetched 27.9 kB in 0s (951 kB/s)
+ dpkg: chrony: dependency problems, but removing anyway as you requested:
+ systemd depends on systemd-timesyncd | time-daemon; however:
+ Package systemd-timesyncd is not installed.
+ Package time-daemon is not installed.
+ Package systemd-timesyncd which provides time-daemon is not installed.
+ Package chrony which provides time-daemon is to be removed.
+
+ (Reading database ... 31279 files and directories currently installed.)
+ Removing chrony (3.5-6ubuntu5) ...
+ postrm called with unknown argument `remove'
+ dpkg: error processing package chrony (--remove):
+ installed chrony package post-removal script subprocess returned error exit
status 1
+ dpkg: too many errors, stopping
+ Errors were enc