2

Last time I was able to install is install adobe using snap now I cant install anything and having multiple errors; when I run sudo dpkg --configure -a , sudo apt-get -f install I get below

martin@martin:~$ sudo dpkg --configure -a
Setting up php-pear (1:1.10.8+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1) ...
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error processing package php-pear (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up mysql-common (5.8+1.0.4) ...
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error processing package mysql-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up mysql-utilities (1.6.4-1) ...
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error processing package mysql-utilities (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up apache2 (2.4.29-1ubuntu4.13) ...
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error processing package apache2 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up git (1:2.17.1-1ubuntu0.7) ...
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error processing package git (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 php-pear
 mysql-common
 mysql-utilities
 apache2
 git
martin@martin:~$ 

This is a copy of my /var/lib/dpkg/status

  GNU nano 2.9.3                                                  /var/lib/dpkg/status                                                            

Description: API library for scanners -- utilities
 SANE stands for "Scanner Access Now Easy" and is an application
 programming interface (API) that provides standardized access to any
 raster image scanner hardware (flatbed scanner, hand-held scanner,
 video- and still-cameras, frame-grabbers, etc.). The SANE standard is
 free and its discussion and development are open to everybody. The
 current source code is written to support several operating systems,
 including GNU/Linux, OS/2, Win32 and various Unices and is available
 under the GNU General Public License (commercial applications and
 backends are welcome, too, however).
 .
 This package includes the command line frontend scanimage, the saned
 server and the sane-find-scanner utility, along with their documentation.
Homepage: http://www.sane-project.org
Original-Maintainer: Jörg Frings-Fürst <debian@jff-webhosting.net>

Package: python-yaml
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 468
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: pyyaml
Version: 3.12-1build2
Depends: python (<< 2.8), python (>= 2.7~), python:any (<< 2.8), python:any (>= 2.7.5-5~), libc6 (>= 2.14), libyaml-0-2
Description: YAML parser and emitter for Python
 Python-yaml is a complete YAML 1.1 parser and emitter for Python.  It can parse
 all examples from the specification. The parsing algorithm is simple enough to
 be a reference for YAML parser implementors. A simple extension API is also
 provided.  The package is built using libyaml for improved speed.

^G Get Help     ^O Write Out    ^W Where Is     ^K Cut Text     ^J Justify      ^C Cur Pos      M-U Undo        M-A Mark Text   M-] To Bracket
^X Exit         ^R Read File    ^\ Replace      ^U Uncut Text   ^T To Spell     ^_ Go To Line   M-E Redo        M-6 Copy Text   M-W WhereIs Next

When I try removing php-pear

martin@martin:~$ sudo apt-get remove php-pear
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  php-cli php-xml php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline php7.2-xml
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  php-pear
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 2,117 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 173197 files and directories currently installed.)
Removing php-pear (1:1.10.8+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1) ...
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error processing package php-pear (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg-maintscript-helper: error: dpkg: error: unknown option --validate-version

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 php-pear
E: Sub-process /usr/bin/dpkg returned an error code (1)
martin@martin:~$ 

EDIT:

martin@martin:~$ python -V
Python 2.7.17
martin@martin:~$ which python
/usr/bin/python
martin@martin:~$ 

dpkg:

martin@martin:~$ dpkg --version
Debian `dpkg' package management program version 1.17.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
martin@martin:~$ 
7
  • Please add the output of python -V and which python
    – pLumo
    Jun 10, 2020 at 8:23
  • Question with same error message: askubuntu.com/questions/1181590/…, but not resolved
    – pLumo
    Jun 10, 2020 at 8:26
  • And dpkg --version :-)
    – pLumo
    Jun 10, 2020 at 8:32
  • @pLumo updated.
    – guradio
    Jun 10, 2020 at 8:49
  • 1
    so this is the root issue. 18.04 has dpkg version 1.19.0.5. I have no clue how you got a wrong dpkg version installed and how you reverse it ... Maybe try downloading the deb and install manually. Problem is of course that for installing a deb, you use dpkg.... if that is not working you have a problem. Maybe you need to compile and install from source? or maybe someone else can help or see this.
    – pLumo
    Jun 10, 2020 at 8:55

1 Answer 1

2

Your dpkg has wrong version somehow, Ubuntu 18.04 currently has version 1.19.0.5. You need to reinstall dpkg:

Try this:

sudo -i
mkdir /tmp/dpkg
cd /tmp/dpkg
wget http://launchpadlibrarian.net/366329727/dpkg_1.19.0.5ubuntu2_amd64.deb
ar x dpkg*.deb data.tar.xz
tar xvf data.tar.xz ./usr/bin/dpkg
cp ./usr/bin/dpkg /usr/bin/
apt-get update
apt-get install --reinstall dpkg

From can't install software--can I fix missing dpkg?

7
  • im getting no entry data.tar.gz in archive from ar x dpkg*.deb data.tar.gz
    – guradio
    Jun 10, 2020 at 9:14
  • Yeah just noticed it is .xz and not .gz in the deb file. See my update
    – pLumo
    Jun 10, 2020 at 9:14
  • that is "good", as it indeed fixes the dpkg issue, but you have other issues, too. Try: a2dismod mpm_prefork, then try again.
    – pLumo
    Jun 10, 2020 at 9:39
  • that did the trick. Now i just need to fix problem with apache not starting I think I can handle that now thank you very much. I wish i have you brains and ubuntu knowledge :)
    – guradio
    Jun 10, 2020 at 9:46
  • Great :-) If you have problems with that, you can ask another question.
    – pLumo
    Jun 10, 2020 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.