After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785515 - Let apt/dpkg in a corrupted state when interrupting an installc
Let apt/dpkg in a corrupted state when interrupting an installc
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
3.25.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-07-28 07:05 UTC by Sebastien Bacher
Modified: 2017-08-16 15:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ok, here we go. I'm not sure about the name - what do you think? For me, it also went back to being cancellable at the end for like 0.5 seconds, but I'm not sure what that means. It's way too late to cancel at that point. I guess that was after the PkTran (8.36 KB, patch)
2017-08-08 14:02 UTC, Iain Lane
none Details | Review
Allow plugins to say that installation can/cannot be cancelled (9.24 KB, patch)
2017-08-08 18:29 UTC, Iain Lane
committed Details | Review
Allow plugins to say that installation can/cannot be cancelled (9.75 KB, patch)
2017-08-16 15:40 UTC, Iain Lane
committed Details | Review

Description Sebastien Bacher 2017-07-28 07:05:36 UTC
Using 3.25.4 on Ubuntu
- select a deb package (e.g gnome-dictionary)
- click on install
- interrupt the install before it's finish by clicking on the corresponding button

-> the system is let in a state when apt refuses to work until "dpkg --configure -a" is used
Comment 1 Richard Hughes 2017-08-05 15:53:16 UTC
I'm guessing the allow-cancel stuff should bubble down into the GNOME UI.
Comment 2 Iain Lane 2017-08-08 14:02:31 UTC
Created attachment 357195 [details] [review]
ok, here we go. I'm not sure about the name - what do you think? For me, it also went back to being cancellable at the end for like 0.5 seconds, but I'm not sure what that means. It's way too late to cancel at that point. I guess that was after the PkTran

---

Allow plugins to say that installation can/cannot be cancelled

For example - it's not safe to cancel a distro package installation
after it has gone past a certain point, or else you'll end up with a
broken system.

Also implement this for the PackageKit plugin by propagating the
allow-cancel property up.
Comment 3 Iain Lane 2017-08-08 14:03:50 UTC
ffs, sorry about that

...I guess that was after the PkTransaction had finished, but does it ever make sense to go from TRUE to FALSE and then back again here? We could fix it in GS so that you can't flip flop - once you say you're uncancellable that is for life.
Comment 4 Iain Lane 2017-08-08 18:29:52 UTC
Created attachment 357213 [details] [review]
Allow plugins to say that installation can/cannot be cancelled

For example - it's not safe to cancel a distro package installation
after it has gone past a certain point, or else you'll end up with a
broken system.

Also implement this for the PackageKit plugin by propagating the
allow-cancel property up.

--

Take #2. This time I made the PK plugin never go from FALSE to TRUE, because I don't think that makes sense. The plugins can handle this themselves, I think, rather than trying to do it centrally. Also I remembered to set it back to TRUE after the installation is finished - maybe *that* does make sense to do centrally? In here I do it in the plugin.
Comment 5 Iain Lane 2017-08-16 15:40:07 UTC
The following fix has been pushed:
82bd6c4 Allow plugins to say that installation can/cannot be cancelled
Comment 6 Iain Lane 2017-08-16 15:40:11 UTC
Created attachment 357736 [details] [review]
Allow plugins to say that installation can/cannot be cancelled

For example - it's not safe to cancel a distro package installation
after it has gone past a certain point, or else you'll end up with a
broken system.

Also implement this for the PackageKit plugin by propagating the
allow-cancel property up.
Comment 7 Iain Lane 2017-08-16 15:41:31 UTC
This should fix the reported problem in gnome-software by not allowing you to cancel any more - the PackageKit task is tracked at

  https://github.com/hughsie/PackageKit/issues/209