From 244bf4d107d7f17eb7a21b036717a161618387ae Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Thu, 19 Mar 2026 20:20:01 +0100 Subject: pkgAcqMetaBase: Commit InRelease after other transaction items If apt update is interrupted during transaction commit, the system may end up with updated InRelease that does not match the other list files, which can cause apt to believe that the lists are already up-to-date when they are in fact not. Closes: #1078608 --- apt-pkg/acquire-item.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 458868bec..b77bccc9d 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1348,8 +1348,12 @@ void pkgAcqMetaBase::CommitTransaction() for (std::vector::iterator I = Transaction.begin(); I != Transaction.end(); ++I) { - (*I)->TransactionState(TransactionCommit); + if (*I != this) + (*I)->TransactionState(TransactionCommit); } + // commit ourselves last to not end up with fresh InRelease + // that doesn't match other files when killed mid-commit + TransactionState(TransactionCommit); Transaction.clear(); } /*}}}*/ -- cgit v1.2.3-70-g09d2