<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>42504</bug_id>
          
          <creation_ts>2022-04-20 11:13:03 +0300</creation_ts>
          <short_desc>apt-get stops if synaptic is running during package install.</short_desc>
          <delta_ts>2023-06-29 12:07:24 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>apt</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>40348</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Iakunin Andrei">iakuninaa</reporter>
          <assigned_to name="Ivan Zakharyaschev">imz</assigned_to>
          <cc>boyarsh</cc>
    
    <cc>glebfm</cc>
    
    <cc>imz</cc>
    
    <cc>iv</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>209762</commentid>
    <comment_count>0</comment_count>
    <who name="Iakunin Andrei">iakuninaa</who>
    <bug_when>2022-04-20 11:13:03 +0300</bug_when>
    <thetext>Way to reproduce:
Open synaptic, use root password. 
Find some package (for example libgmp-devel) and check for install (!!!)

In konsole execute: $sudo apt-get install something (i tried virt-viewer)
Same for $apt-get remove

First package will be installed, and then apt-get stops.
apt-get do not respond on ^z and ^c. 
apt-get will resume if synaptic will be closed. 
But if user forget about synaptic and kill apt-get(by kill -9 or closing konsole window) system may stay in unstable state. With, for example, two versions of same lib installed.

Proposal -- check if other PM is running at start of apt-get.
Debian, as i remember, does not start apt if synaptic is running.


$apt-get --version
apt 0.5.15lorg2 для linux x86_64 собран Feb  9 2022 23:33:31

$apt-cache show synaptic
Package: synaptic
Section: System/Configuration/Packaging
Installed Size: 5094531
Maintainer: Ivan Zakharyaschev &lt;imz@altlinux.org&gt;
Version: 0.58-alt28:p10+295130.700.2.1@1644479727</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>214377</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2022-09-01 15:50:55 +0300</bug_when>
    <thetext>Thanks for the report! (I hope someone some day will think about it and implement a solution.)

A few more lock-related observations:

* Now, concurrent install/remove actions can lead to broken state at the end -- https://bugzilla.altlinux.org/40348

* Waiting for locks before starting another instance of apt in Debian -- https://unix.stackexchange.com/q/242539/4319</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>214380</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2022-09-01 15:58:15 +0300</bug_when>
    <thetext>I&apos;m afraid that having just a lock for apt wouldn&apos;t solve a potential race between plain rpm and apt-or-whatever, as described in https://bugzilla.altlinux.org/40348 ; if a more tricky locking scheme is implemented in rpm (like the one suggested there), that would make &quot;apt-get install&quot; (or &quot;rpm -U&quot;) at least not start the installation as long as synaptic holds a read-lock on the database. (Probably, that is the reason for the described behavior, but I might be wrong.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>