Error upgrading mailman

Discussion in 'General' started by gurumelo, Nov 11, 2021.

Tags:
  1. gurumelo

    gurumelo New Member

    Debian 9
    Upgrading mailman
    Installed: 1:2.1.23-1+deb9u6
    Candidate: 1:2.1.23-1+deb9u7

    apt update
    apt upgrade

    errors
    Fetched 6,748 kB in 0s (12.4 MB/s)
    Reading changelogs... Done
    Preconfiguring packages ...
    File "/var/lib/mailman/bin/list_lists", line 75
    except getopt.error, msg:
    ^
    SyntaxError: invalid syntax
    (Reading database ... 99804 files and directories currently installed.)
    Preparing to unpack .../00-mailman_1%3a2.1.23-1+deb9u7_amd64.deb ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /tmp/apt-dpkg-install-vEhtzR/00-mailman_1%3a2.1.23-1+deb9u7_amd64.deb (--unpack):
    subprocess new pre-removal script returned error exit status 1
    File "/var/lib/mailman/bin/list_lists", line 75
    except getopt.error, msg:
    ^
    SyntaxError: invalid syntax
    File "/usr/lib/mailman/bin/update", line 107
    print C_('Fixing language templates: %(listname)s')
    ^
    SyntaxError: invalid syntax
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1
    Preparing to unpack .../01-python-pil_4.0.0-4+deb9u3_amd64.deb ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /tmp/apt-dpkg-install-vEhtzR/01-python-pil_4.0.0-4+deb9u3_amd64.deb (--unpack):
    subprocess new pre-removal script returned error exit status 1
    Traceback (most recent call last):
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1
    Preparing to unpack .../02-python-imaging_4.0.0-4+deb9u3_all.deb ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /tmp/apt-dpkg-install-vEhtzR/02-python-imaging_4.0.0-4+deb9u3_all.deb (--unpack):
    subprocess new pre-removal script returned error exit status 1
    Traceback (most recent call last):
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1
    Preparing to unpack .../03-python-lxml_3.7.1-1+deb9u4_amd64.deb ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /tmp/apt-dpkg-install-vEhtzR/03-python-lxml_3.7.1-1+deb9u4_amd64.deb (--unpack):
    subprocess new pre-removal script returned error exit status 1
    Traceback (most recent call last):
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1
    Preparing to unpack .../04-python-xdg_0.25-4+deb9u1_all.deb ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
    File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
    ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /tmp/apt-dpkg-install-vEhtzR/04-python-xdg_0.25-4+deb9u1_all.deb (--unpack):
    subprocess new pre-removal script returned error exit status 1
    Traceback (most recent call last):
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1


    Errors were encountered while processing:
    /tmp/apt-dpkg-install-vEhtzR/00-mailman_1%3a2.1.23-1+deb9u7_amd64.deb
    /tmp/apt-dpkg-install-vEhtzR/01-python-pil_4.0.0-4+deb9u3_amd64.deb
    /tmp/apt-dpkg-install-vEhtzR/02-python-imaging_4.0.0-4+deb9u3_all.deb
    /tmp/apt-dpkg-install-vEhtzR/03-python-lxml_3.7.1-1+deb9u4_amd64.deb
    /tmp/apt-dpkg-install-vEhtzR/04-python-xdg_0.25-4+deb9u1_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    Thanks
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That does not look like error in ISPConfig. The updated files have syntax errors. Unless the files had broken download the system maybe is missing some interpreter? What show commands
    Code:
    apt policy mailman
    lsb_release -a
    apt update
     
    gurumelo likes this.
  3. gurumelo

    gurumelo New Member

    Hello @Taleman , thank you for your response.

    Code:
    
    :~# apt policy mailman
    mailman:
      Installed: 1:2.1.23-1+deb9u6
      Candidate: 1:2.1.23-1+deb9u7
      Version table:
         1:2.1.23-1+deb9u7 500
            500 http://security.debian.org stretch/updates/main amd64 Packages
     *** 1:2.1.23-1+deb9u6 100
            100 /var/lib/dpkg/status
         1:2.1.23-1+deb9u5 500
            500 http://httpredir.debian.org/debian stretch/main amd64 Packages
    
    :~# lsb_release -a
    No LSB modules are available.
    Distributor ID:    Debian
    Description:    Debian GNU/Linux 9.13 (stretch)
    Release:    9.13
    Codename:    stretch
    
    
    :~# apt update
    Hit:1 http://security.debian.org stretch/updates InRelease
    Ign:2 http://httpredir.debian.org/debian stretch InRelease                    
    Hit:3 http://dl.hhvm.com/debian stretch InRelease                             
    Hit:4 http://httpredir.debian.org/debian stretch-updates InRelease            
    Ign:5 http://packages.prosody.im/debian stretch InRelease                     
    Hit:6 http://httpredir.debian.org/debian stretch Release                          
    Reading package lists... Done                          
    
    
     
    Last edited: Nov 11, 2021
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Sounds like your python environment is messed up. That class is provided by:
    Code:
    # dpkg -S /usr/lib/python2.7/ConfigParser.py
    libpython2.7-minimal:amd64: /usr/lib/python2.7/ConfigParser.py
    You might check what version(s) of python you have installed, and maybe force reinstall the libpython2.7-minimal package (if the package tools are working enough to do so).
     
    gurumelo likes this.
  5. gurumelo

    gurumelo New Member

    Hello @Jesse Norell , thank you very much for your response.
    Output

    Code:
    
    :~# dpkg -S /usr/lib/python2.7/ConfigParser.py
    libpython2.7-minimal:amd64: /usr/lib/python2.7/ConfigParser.py
    
    
    The "problem" is that install operations on apt are blocked for mailman error. Then, i can't do apt-get install --reinstall libpython2.7-minimal.
    Thanks
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I agree with @Jesse Norell , python probably is somehow broken.
    Have you changed python version? Has some python package been removed?
    What shows
    Code:
    apt policy libpython2.7-minimal
    dpkg --print-architecture
    
    You can put mailman in hold, so it is not updated, or remove the mailman package. Removing without purge does not remove the configuration files so it is easy to install it back when errors are sorted out. Read how hold is done and undone in chapter 4.2.3. Checking packages status from Stretch Release Notes: https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.en.html#review-actions
     
    gurumelo likes this.
  7. gurumelo

    gurumelo New Member

    Thank you @Taleman .

    Code:
    
    :~# apt policy libpython2.7-minimal
    libpython2.7-minimal:
      Installed: 2.7.13-2+deb9u5
      Candidate: 2.7.13-2+deb9u5
      Version table:
     *** 2.7.13-2+deb9u5 500
            500 http://security.debian.org stretch/updates/main amd64 Packages
            100 /var/lib/dpkg/status
         2.7.13-2+deb9u3 500
            500 http://httpredir.debian.org/debian stretch/main amd64 Packages
    
    :~# dpkg --print-architecture
    amd64
    
    
    I will test with remove and install mailman. Thank you very much.
     
  8. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Depending on how important mailman is and the time you can have it down to fix things, you may want to make a backup before removing it.
     
    gurumelo likes this.
  9. gurumelo

    gurumelo New Member

    I found out that in the past, admins compiled by hand python 3.8
    then
    Code:
    :/etc/alternatives# ls -lah python
    lrwxrwxrwx 1 root root 24 Feb 22  2021 python -> /usr/local/bin/python3.8
    
    I solved with
    Code:
    update-alternatives --config python
    
    I choosed 2.7

    Thank you @Jesse Norell and @Taleman
     
    till likes this.

Share This Page