0

When I issue the following command:

apt-get install ssh

I receive the following errors

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  base-files libedit2 libssl1.0.0 libxmuu1 ncurses-term openssh-client openssh-server openssh-sftp-server python3-certifi python3-chardet
  python3-idna python3-pkg-resources python3-requests python3-six python3-urllib3 ssh-import-id wget xauth
Suggested packages:
  keychain libpam-ssh monkeysphere ssh-askpass molly-guard rssh ufw python3-setuptools python3-cryptography python3-openssl python3-socks
The following NEW packages will be installed:
  libedit2 libssl1.0.0 libxmuu1 ncurses-term openssh-client openssh-server openssh-sftp-server python3-certifi python3-chardet python3-idna
  python3-pkg-resources python3-requests python3-six python3-urllib3 ssh ssh-import-id wget xauth
The following packages will be upgraded:
  base-files
1 upgraded, 18 newly installed, 0 to remove and 12 not upgraded.
5 not fully installed or removed.
Need to get 0 B/3,343 kB of archives.
After this operation, 17.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 11001 files and directories currently installed.)
Preparing to unpack .../base-files_10.1ubuntu2.7_amd64.deb ...
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 archive /var/cache/apt/archives/base-files_10.1ubuntu2.7_amd64.deb (--unpack): subprocess new pre-installation 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 new post-removal script returned error exit status 1 Errors were encountered while processing: /var/cache/apt/archives/base-files_10.1ubuntu2.7_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

I did all the solutions here and here but none of the works for me!

Then I tried:

dpkg --configure -a 

That gives the following result:

Setting up python3 (3.6.7-1~18.04) ...
running python rtupdate hooks for python3.6...
dpkg-query: package 'dh-python' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of dh-python
error running python rtupdate hook dh-python
dpkg-query: package 'gedit' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of gedit
error running python rtupdate hook gedit
dpkg-query: package 'hplip-data' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of hplip-data
error running python rtupdate hook hplip-data
dpkg-query: package 'ibus-table' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ibus-table
error running python rtupdate hook ibus-table
dpkg-query: package 'ibus' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ibus
error running python rtupdate hook ibus
dpkg-query: package 'libglib2.0-dev-bin' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of libglib2.0-dev-bin
error running python rtupdate hook libglib2.0-dev-bin
dpkg-query: package 'python3-uno' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of python3-uno
error running python rtupdate hook python3-uno
dpkg-query: package 'rhythmbox-plugin-alternative-toolbar' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of rhythmbox-plugin-alternative-toolbar
error running python rtupdate hook rhythmbox-plugin-alternative-toolbar
dpkg-query: package 'rhythmbox-plugins' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of rhythmbox-plugins
error running python rtupdate hook rhythmbox-plugins
dpkg-query: package 'system-config-printer-common' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of system-config-printer-common
error running python rtupdate hook system-config-printer-common
dpkg-query: package 'system-config-printer' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of system-config-printer
error running python rtupdate hook system-config-printer
dpkg-query: package 'ubuntu-drivers-common' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ubuntu-drivers-common
error running python rtupdate hook ubuntu-drivers-common
dpkg: error processing package python3 (--configure):
 subprocess installed post-installation script returned error exit status 4
dpkg: dependency problems prevent configuration of python3-gi:
 python3-gi depends on python3 (<< 3.7); however:
  Package python3 is not configured yet.
 python3-gi depends on python3 (>= 3.6~); however:
  Package python3 is not configured yet.
 python3-gi depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-gi (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of networkd-dispatcher: networkd-dispatcher depends on python3-gi; however: Package python3-gi is not configured yet. networkd-dispatcher depends on python3:any; however: Package python3 is not configured yet.

dpkg: error processing package networkd-dispatcher (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3-dbus: python3-dbus depends on python3 (<< 3.7); however: Package python3 is not configured yet. python3-dbus depends on python3 (>= 3.6~); however: Package python3 is not configured yet. python3-dbus depends on python3:any (>= 3.4~); however: Package python3 is not configured yet.

dpkg: error processing package python3-dbus (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3 python3-gi networkd-dispatcher python3-dbus

then in the root mode: I try the following command:

python -V

I get this:

Python 3.7.2

At last, can't go on the solution on web, because, when entering any command started with "dkpg" and "apt", I get the first error.

I try to install the dkpg from the base so, download the last version from the dpkg 1.18.25 page on snapshot.debian.org.

sudo dpkg -i dpkg_1.18.25_amd64.deb

then I try to use apt command, but again I get the error again.

Eliah Kagan
  • 117,780

1 Answers1

0

The key to understanding this wall of text is dpkg: error: unknown option --validate-version. Get rid of that crappy Python version 3.7.2 and use (restore) the default Python 2 version with sudo apt install python-all and this wall of error messages will disappear. I can tell that python 3.7.2 in not the default version, because it isn't in the default repositories for any currently supported version of Ubuntu, so you must have installed it either manually or from a PPA. If you need more information, comment to tell what Ubuntu version you are using and the results of which python3 and which python3.7.

karel
  • 114,770
  • Thanks. I restore to default version python in root mode. [python 2.7.0] But It gives the same error. Finally, after many tries, I quit :( . Reinstall ubuntu 18.04. – m.ghoroobi Oct 20 '19 at 14:14