E: Sub-process /usr/bin/dpkg returned an error code (1)
错误描述:
dpkg: error processing archive /var/cache/apt/archives/libfreetype6-dev_2.5.2-4ubuntu2_amd64.deb (--unpack):
trying to overwrite shared '/usr/share/man/man1/freetype-config.1.gz', which is different from other instances of package libfreetype6-dev:amd64
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for doc-base (0.10.6) ...
Processing triggers for man-db (2.7.4-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/libfreetype6-dev_2.5.2-4ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
错误原因:
The above error is that there are multiple libfreetype6-dev_2.5.2-4ubuntu2_amd64.deb locales, which
cannot be directly overwritten. This makes it impossible to install.
Eventually, all apt-get install/remove cannot run the
repair process:
1. sudo dpkg --configure -a Check the cause of the error
2. sudo dpkg -i --force-overwrite /var/cache/apt/archives/libfreetype6-dev_2.5.2-4ubuntu2_amd64.deb force replacement
3. sudo apt-get autoremove remove useless packages
4. sudo apt- get update
last run: sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded. Back
to normal.