0

I tried to do a apt upgrade and Samba failed to upgrade:

Preparing to unpack .../python-urllib3_1.13.1-2ubuntu0.16.04.2_all.deb ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 25, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 77, in <module>
    import textwrap
ValueError: bad marshal data (string ref out of range)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 25, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 77, in <module>
    import textwrap
ValueError: bad marshal data (string ref out of range)
dpkg: error processing archive /var/cache/apt/archives/python-urllib3_1.13.1-2ubuntu0.16.04.2_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 27, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 77, in <module>
    import textwrap
ValueError: bad marshal data (string ref out of range)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to unpack .../python-requests_2.9.1-3ubuntu0.1_all.deb ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 25, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 77, in <module>
    import textwrap
ValueError: bad marshal data (string ref out of range)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 25, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 77, in <module>
    import textwrap
ValueError: bad marshal data (string ref out of range)
dpkg: error processing archive /var/cache/apt/archives/python-requests_2.9.1-3ubuntu0.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 27, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 77, in <module>
    import textwrap
ValueError: bad marshal data (string ref out of range)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1

I've tried to force install, clean everything. From what it looks like it is failing to upgrade a dependency for samba because a python script runs and this errors. But I cannot find a solution, any help?

Cheers

4
  • 1
    Seems optparse is corrupted. try reinstalling python2 using sudo apt-get install --reinstall libpython2.7-minimal
    – Anunay
    Commented Oct 23, 2018 at 16:11
  • Try to remove problematic deb-archive from cache with sudo rm /var/cache/apt/archives/python-urllib3_1.13.1-2ubuntu0.16.04.2_all.deb and sudo rm /var/cache/apt/archives/python-requests_2.9.1-3ubuntu0.1_all.deb. Then resume installation with sudo apt-get install -f and sudo dpkg --configure -a .
    – N0rbert
    Commented Oct 23, 2018 at 20:31
  • Thanks guys, so @Anunay this resulted in You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies. python-samba : Depends: samba-libs (= 2:4.3.11+dfsg-0ubuntu0.16.04.15) but 2:4.3.11+dfsg-0ubuntu0.16.04.17 is to be installed @N0rbert, this resulted in the same message as above :( I think that python is the problem and that needs reinstalling but because samba is bust it's preventing me from reinstalling. I guess I need to fix python manually? Commented Oct 26, 2018 at 8:45
  • @marcusorjames Did you try --force installing it, as apt-get -f install libpython2.7-minimal
    – Anunay
    Commented Oct 26, 2018 at 9:10

0

You must log in to answer this question.

Browse other questions tagged .