1

I keep trying to install nmap and getting an error returned...

Can anyone please help?

root@cola:~# apt-get install nmap -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  debian-archive-keyring
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  gcc-7-base libblas3 libc-bin libc-l10n libc6 libgcrypt20 libgfortran4
  libgpg-error0 liblinear3 liblua5.3-0 libquadmath0 libssh2-1 libssl1.1
  libstdc++6 libxslt1.1 locales ndiff nmap-common python-bs4 python-html5lib
  python-lxml python-pkg-resources python-webencodings
Suggested packages:
  glibc-doc rng-tools liblinear-tools liblinear-dev zenmap python-genshi
  python-lxml-dbg python-lxml-doc python-setuptools
The following NEW packages will be installed:
  gcc-7-base libblas3 libc-l10n libgcrypt20 libgfortran4 liblinear3
  liblua5.3-0 libquadmath0 libssh2-1 libssl1.1 libxslt1.1 ndiff nmap
  nmap-common python-bs4 python-html5lib python-lxml python-pkg-resources
  python-webencodings
The following packages will be upgraded:
  libc-bin libc6 libgpg-error0 libstdc++6 locales
5 upgraded, 19 newly installed, 0 to remove and 393 not upgraded.
Need to get 0 B/19.2 MB of archives.
After this operation, 47.1 MB of additional disk space will be used.
Preconfiguring packages ...
dpkg-deb: error: archive '/var/cache/apt/archives/locales_2.25-2_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/locales_2.25-2_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
dpkg-deb: error: archive '/var/cache/apt/archives/libc-l10n_2.25-2_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/libc-l10n_2.25-2_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
dpkg-deb: error: archive '/var/cache/apt/archives/libc6_2.25-2_amd64.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/libc6_2.25-2_amd64.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/locales_2.25-2_all.deb
 /var/cache/apt/archives/libc-l10n_2.25-2_all.deb
 /var/cache/apt/archives/libc6_2.25-2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@cola:~#
2
  • 1
    Your problem seems to have nothing to do with nmap. You seem to have three damaged or corrupted packages. They are clearly listed in the error messages. Clean each out using apt clean <packagename>
    – user535733
    Dec 3, 2017 at 14:27
  • I suspect the three .deb files with premature member errors are of a newer version/format, and that your apt-get and dpkg tools are too old to handle them properly. In March 2018, I encountered similar errors trying to process .deb files from Debian sid using the four(?) year old version of dpkg that shipped with Ubuntu 14.04. Unfortunately, I have no suggestions for a workaround.
    – mpb
    Mar 13, 2018 at 1:51

1 Answer 1

3

According this post clean-up cache, you need to clean up cache stored by apt. also you need to upgrade your installed software to latest version.

Removing APT cache

sudo apt clean && sudo apt autoclean

Updating APT

sudo apt update

If there's available software to upgrade then run

sudo apt upgrade

then you can continue installing nmap

sudo apt install nmap

Hope this work for you.

2
  • 1
    With aptthe correct argument is full-upgrade (dist-upgrade is to be used with apt-get). Either way there's no point in doing upgrade before. Dist/full does everything upgrade alone does and more. And why -y for installing? Don't you think it would be better to have confirmation and error messages shown instead?
    – user692175
    Dec 3, 2017 at 15:25
  • 1
    aparrently sudo apt dist-upgrade can also be used and seems to be the same as sudo apt full-upgrade and sudo apt-get dist-upgrade ;)
    – derHugo
    Dec 3, 2017 at 20:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .