Check if you are using third party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f
Transaction failed: The package system is broken
The following packages have unmet dependencies:
libpng12-dev: Depends: libpng12-0 (= 1.2.54-1ubuntu1) but it is not installed
然后,当我尝试运行时:
sudo apt install libpng12-0
结果是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfprint-2-tod1 libllvm9 libssl1.0.0
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
libpng12-0
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/116 kB of archives.
After this operation, 285 kB of additional disk space will be used.
(Reading database ... 259277 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--unpack):
unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
Errors were encountered while processing:
/var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试过了sudo apt upgrade
。它还显示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpng12-dev : Depends: libpng12-0 (= 1.2.54-1ubuntu1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
我试过了sudo 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:
libfprint-2-tod1 libllvm9 libssl1.0.0
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libpng12-0
The following NEW packages will be installed:
libpng12-0
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/116 kB of archives.
After this operation, 285 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 259277 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--unpack):
unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
Errors were encountered while processing:
/var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
非常感谢兄弟,我试过了
sudo apt install libpng-dev
它工作正常并且升级成功:)