E
E
Egorian2018-06-09 15:35:56
linux
Egorian, 2018-06-09 15:35:56

Unmet dependencies. How to fix?

On apt-get upgrade and apt-get install ... I started getting an error

The following packages have unmet dependencies:
 g++-7 : Depends: libstdc++-7-dev (= 7.3.0-21) but 7.2.0-18 is installed
 libstdc++-7-dev : Depends: gcc-7-base (= 7.2.0-18) but 7.3.0-21 is installed
                   Depends: libgcc-7-dev (= 7.2.0-18) but 7.3.0-21 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Typing apt --fix-broken install does not help:
[email protected]:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libcharls1 libfabric1 libgdcm2.8 libgl2ps1.4 libhdf5-openmpi-100 libisl15 liblept5 libnetcdf-c++4 libopencv-calib3d3.2 libopencv-contrib3.2
  libopencv-core3.2 libopencv-features2d3.2 libopencv-flann3.2 libopencv-highgui3.2 libopencv-imgcodecs3.2 libopencv-imgproc3.2 libopencv-ml3.2
  libopencv-objdetect3.2 libopencv-photo3.2 libopencv-shape3.2 libopencv-stitching3.2 libopencv-superres3.2 libopencv-video3.2 libopencv-videoio3.2
  libopencv-videostab3.2 libopencv-viz3.2 libopenmpi2 libpsm-infinipath1 libsocket++1 libsrtp0 libtbb2 libtesseract4 libtxc-dxtn-s2tc libvtk6.3
  libx265-146 openmpi-bin openmpi-common
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libstdc++-7-dev
Suggested packages:
  libstdc++-7-doc
The following packages will be upgraded:
  libstdc++-7-dev
1 upgraded, 0 newly installed, 0 to remove and 1332 not upgraded.
3 not fully installed or removed.
Need to get 0 B/1,454 kB of archives.
After this operation, 27.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/libstdc++-7-dev_7.3.0-21_amd64.deb' to decompressor pipe: failed to write (Broken pipe)
Reading changelogs... Done
(Reading database ... 326383 files and directories currently installed.)
Preparing to unpack .../libstdc++-7-dev_7.3.0-21_amd64.deb ...
Unpacking libstdc++-7-dev:amd64 (7.3.0-21) over (7.2.0-18) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libstdc++-7-dev_7.3.0-21_amd64.deb (--unpack):
 cannot copy extracted data for './usr/include/c++/7/ext/mt_allocator.h' to '/usr/include/c++/7/ext/mt_allocator.h.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
 /var/cache/apt/archives/libstdc++-7-dev_7.3.0-21_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cppjunkie, 2018-06-09
@Egorian

It looks like the libstdc++-7-dev package downloaded awry, because writes "lzma error: compressed data is corrupt", try to somehow remove the downloaded packages from the cache and reinstall. In my opinion, they are stored somewhere in /var/dpkg, but I can’t say for sure (maybe /var/cache/apt/archives, since he writes this in the message?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question