我继续尝试安装 nmap 但返回错误...
有人可以帮忙吗?
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:~#
答案1
根据这篇文章清理缓存,您需要清理 apt 存储的缓存。同时您还需要将安装的软件升级到最新版本。
删除 APT 缓存
sudo apt clean && sudo apt autoclean
更新 APT
sudo apt update
如果有可用的软件可以升级,则运行
sudo apt upgrade
然后你可以继续安装 nmap
sudo apt install nmap
希望这对你有用。