처리하는 동안 오류가 발생했습니다: /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb

처리하는 동안 오류가 발생했습니다: /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb

다음과 같은 문제가 있습니다.

Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

또한 패키지를 설치/제거/업그레이드할 수 없습니다.

시험을 마친:

sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade

산출:

Hit:1 http://repo.yandex.ru/yandex-disk/deb stable InRelease
Hit:2 http://ru.archive.ubuntu.com/ubuntu xenial InRelease          
Get:3 http://ru.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]                     
Hit:4 http://ppa.launchpad.net/diesch/testing/ubuntu xenial InRelease                                      
Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]                                 
Hit:6 http://ppa.launchpad.net/noobslab/apps/ubuntu xenial InRelease                                                
Hit:7 http://ppa.launchpad.net/numix/ppa/ubuntu xenial InRelease                                                                                           
Get:8 http://ru.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]                                                                   
Hit:9 http://ppa.launchpad.net/ricotz/docky/ubuntu xenial InRelease                                                                                        
Hit:10 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease                                                                         
Ign:11 http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04  InRelease                 
Hit:12 http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04  Release
Fetched 306 kB in 1s (288 kB/s)                    
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-51 linux-headers-4.4.0-51-generic linux-image-4.4.0-51-generic linux-image-extra-4.4.0-51-generic ubuntu-core-launcher
Use 'sudo apt autoremove' to remove them.
The following packages have been kept back:
  gnome-software gnome-software-common liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 oxideqt-codecs-extra ubuntu-software
The following packages will be upgraded:
  apport
1 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
111 not fully installed or removed.
Need to get 120 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ru.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apport all 2.20.1-0ubuntu2.4 [120 kB]
Fetched 120 kB in 0s (606 kB/s) 
(Reading database ... 301001 files and directories currently installed.)
Preparing to unpack .../apport_2.20.1-0ubuntu2.4_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 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_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
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

시험을 마친:

sudo dpkg --configure -a
sudo apt-get -f install

산출:

...
Errors were encountered while processing:
apport
apport-gtk


Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-51 linux-headers-4.4.0-51-generic linux-image-4.4.0-51-generic linux-image-extra-4.4.0-51-generic ubuntu-core-launcher
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  apport
The following packages will be upgraded:
  apport
1 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
2 not fully installed or removed.
Need to get 0 B/120 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 301001 files and directories currently installed.)
Preparing to unpack .../apport_2.20.1-0ubuntu2.4_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 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_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
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

시험을 마친:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb

산출:

(Reading database ... 301001 files and directories currently installed.)
Preparing to unpack .../apport_2.20.1-0ubuntu2.4_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 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb (--install):
 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
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb

시험을 마친:

sudo apt-get purge apport

산출:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apport-symptoms python3-systemd
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  apport*
0 upgraded, 0 newly installed, 1 to remove and 7 not upgraded.
1 not fully installed or removed.
After this operation, 791 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: error processing package apport (--purge):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 apport
E: Sub-process /usr/bin/dpkg returned an error code (1)

시험을 마친:

sudo dpkg --remove --force-remove-reinstreq apport

산출:

dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 300994 files and directories currently installed.)
Removing apport (2.20.1-0ubuntu2.1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package apport (--remove):
 subprocess installed 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
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 apport

어떤 도움이라도 기쁘겠습니다.

답변1

오늘 Ubuntu 16.04.01 LTS 서버에서 동일한 문제가 발생했습니다. 시스템에서 내가 수행한 작업을 조금 읽고 생각한 후에 기본 Python을 Python3.5로 변경했다는 사실과 관련이 있다고 생각했습니다. 나에게는 Python을 다시 2.7로 변경하고 업그레이드를 수행한 다음 3.5로 다시 전환하는 것이 효과적이었습니다.

기본 Python 변경:

root@web03:~>update-alternatives --list python
/usr/bin/python2.7
/usr/bin/python3
root@web03:~>python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
root@web03:~>update-alternatives --install /usr/bin/python python /usr/bin/python2.7 3
update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode
root@web03:~>python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

dist-upgrade를 수행하십시오. 아마도 제가 했던 것처럼 Python 3을 활성화한 상태에서 시도했다면 -f를 사용하거나 위의 설명에서 --force-remove를 수행해야 할 것입니다.

새로 설치/업그레이드한 후 기본적으로 Python 3이 필요한 경우 Python을 다시 전환할 수 있습니다.

root@web03:~>update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode
root@web03:~>python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

답변2

패키지가 apport_2.20.1-0ubuntu2.4_all.deb문제를 일으키는 것이므로 제거해야 합니다.sudo apt-get purge apport

configparser또한 Python은 모듈 설치 에 대한 오류를 던지고 있습니다 .pip install configparser

답변3

문제:

처리하는 동안 오류가 발생했습니다: /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb E: 하위 프로세스 /usr/bin/dpkg가 오류 코드를 반환했습니다(1)

해결책:

수동으로 삭제됨

$sudo apt-get libobs0 제거

$sudo apt-get 업데이트

$sudo apt-get 설치 obs-studio -y

작동합니다!

관련 정보