我对 Linux 还很陌生,才使用三天,也是这个论坛的新手,如果我犯了错误,请告诉我。
这是我输入 sudo apt-get install oracle-java9-set-default 后收到的错误
Errors were encountered while processing: /var/cache/apt/archives/oracle-java9-set-default_9b126+9b126arm-1~webupd8~0_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
Full output -
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
cabextract chromium-codecs-ffmpeg-extra gstreamer0.10-ffmpeg
libavcodec-extra libhal1-flash libmspack0 libunshield0 oxideqt-codecs-extra
unshield xplayer-plugins-extra
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
oracle-java9-set-default
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 3'540 B of archives.
After this operation, 16.4 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main amd64 oracle-java9-set-default all 9b126+9b126arm-1~webupd8~0 [3'540 B]
Fetched 3'540 B in 1s (2'061 B/s)
Selecting previously unselected package oracle-java9-set-default.
(Reading database ... 235497 files and directories currently installed.)
Preparing to unpack .../oracle-java9-set-default_9b126+9b126arm-1~webupd8~0_all.deb ...
Unpacking oracle-java9-set-default (9b126+9b126arm-1~webupd8~0) ...
dpkg: error processing archive /var/cache/apt/archives/oracle-java9-set-default_9b126+9b126arm-1~webupd8~0_all.deb (--unpack):
trying to overwrite '/etc/profile.d/jdk.csh', which is also in package oracle-java8-set-default 8u101+8u101arm-1~webupd8~2
Errors were encountered while processing:
/var/cache/apt/archives/oracle-java9-set-default_9b126+9b126arm-1~webupd8~0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
在再次安装该包之前,尝试运行这些命令。
这将删除那些未使用的包。
sudo apt-get autoremove
这将更新并升级软件包。
sudo apt-get update && sudo apt-get upgrade