无法找到软件包和 dpkg 错误

无法找到软件包和 dpkg 错误

我试图安装netbeans。现在我无法安装任何东西 - 我尝试时出现各种错误

这是我收到的错误的一个示例:

$ sudo apt-get install defoult-jre
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package defoult-jre

rico@rico-Aspire-5750G:~$ cd Downloads
rico@rico-Aspire-5750G:~/Downloads$ ls
jdk-9.0.1_linux-x64_bin.rpm  netbeans-8.2-linux.sh  popcorntime

rico@rico-Aspire-5750G:~/Downloads$ chmod 755 jdk-9.0.1_linux-x64_bin.rpm
rico@rico-Aspire-5750G:~/Downloads$ sudo ./jdk-9.0.1_linux-x64_bin.rpm 
./jdk-9.0.1_linux-x64_bin.rpm: 1: ./jdk-9.0.1_linux-x64_bin.rpm: cannot create �,�0�@bf802f8c16be99346ce683a49f8ea6015f466193����al�����l0�vz}�>�������9�x?�h��
                          ���   �   K������
                                                                      ��7�  a�s�{�����<}�����   �N�
���
     ���
�H��L��.�.��E�
FdF�H@(Hu7H|>��?��@��C��G�H�
                                                                     �����X��
\�(�
,��*�bԨd�?e�Df�Gl�I��dCjdk-9.0.19.0.1ga�Java Platform Standard Edition Development KitThe Java Platform Standard Edition Development Kit (JDK) includes both
the runtime environment (Java virtual machine, the Java platform classes
and supporting files) and development tools (compilers, debuggers,
tool libraries and other tools).

The JDK is a development environment for building applications, applets
and components that can be deployed with the Java Platform Standard
Edition Runtime Environment.Y�r�sca00llc.us.oracle.comx�Oracle: File name too long
./jdk-9.0.1_linux-x64_bin.rpm: 1: ./jdk-9.0.1_linux-x64_bin.rpm: ����jdk-9.0.1-2000:9.0.1-ga���T: not found
Error: unpack200 - command could not be found.

Please refer to the Troubleshooting section of theInstallation Instructions
on the download page.
./jdk-9.0.1_linux-x64_bin.rpm: 915: [: unexpected operator
./jdk-9.0.1_linux-x64_bin.rpm: 916: [: unexpected operator
/usr/sbin/alternatives not available, skip registering alternatives for java...
./jdk-9.0.1_linux-x64_bin.rpm: 2608: ./jdk-9.0.1_linux-x64_bin.rpm: Syntax error: word unexpected (expecting ")")
rico@rico-Aspire-5750G:~/Downloads$ ls
jdk-9.0.1_linux-x64_bin.rpm  netbeans-8.2-linux.sh  popcorntime
rico@rico-Aspire-5750G:~/Downloads$ sudo apt-get jdk-9.0.1_linuxx64_bin.rpm
E: Invalid operation jdk-9.0.1_linuxx64_bin.rpm
rico@rico-Aspire-5750G:~/Downloads$ sudo apt-get jdk-9.0.1_linux64_bin.rpmE: Invalid operation jdk-9.0.1_linux64_bin.rpm
rico@rico-Aspire-5750G:~/Downloads$ sudo apt-get install jdk-9.0.1_linux64_bin.rpm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package jdk-9.0.1_linux64_bin.rpm

我该怎么办?新东西

rico@rico-Aspire-5750G:~$ cd /var/lib/dpkg/info
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's/=177/=179/' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's/SHA256SUM_TGZ="a6905f3a4245a071880e1793b8d3d6100ef7b171ea1d6ebfe6312c25c2fca8bb"/SHA256SUM_TGZ="06fe58dfa50c4f6ca21dc1d475f16cd9e58db36b1d98582091d7ff9005dda7a7"/' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo apt-get install oracle-java9-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java9-installer is already the newest version (9.0.1-1~webupd8~0).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up java-common (0.56ubuntu2) ...
mkdir: cannot create directory ‘/etc/.java/.systemPrefs’: File exists
dpkg: error processing package java-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java9-installer:
 oracle-java9-installer depends on java-common (>= 0.24); however:
  Package java-common is not configured yet.

dpkg: error processing package oracle-java9-installer (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-9-jre-headless:amd64:
 openjdk-9-jre-headless:amd64 depends on java-common (>= 0.28); however:
  Package java-common is not configured yet.

dpkg: error processing package openjdk-9-jre-headless:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ca-certificates-java:
 ca-certificates-java depends on openjdk-7-jre-headless (>= 7~u3-2.1.1~pre1-1) | java7-runtime-headless; however:
  Package openjdk-7-jre-headless is not installed.
  Version of openjdk-7-jre-headless on system, provided by oracle-java9-installer:amd64, is <none>.
  Package java7-runtime-headless is not installed.No apport report written because the error message indicates its a followup error from a previous failure.
                                                                            No apport report written because the error message indicates its a followup error from a previous failure.
                      No apport report written because MaxReports is reached already

  Package oracle-java9-installer which provides java7-runtime-headless is not configured yet.
  Package openjdk-9-jre-headless:amd64 which provides java7-runtime-headless is not configured yet.

dpkg: error processing package ca-certificates-java (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 java-common
 oracle-java9-installer
 openjdk-9-jre-headless:amd64
 ca-certificates-java
E: Sub-process /usr/bin/dpkg returned an error code (1)
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ oracle-java9-installer.config
oracle-java9-installer.config: command not found
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ cd ..
rico@rico-Aspire-5750G:/var/lib/dpkg$ cd..
cd..: command not found
rico@rico-Aspire-5750G:/var/lib/dpkg$ cd..
cd..: command not found
rico@rico-Aspire-5750G:/var/lib/dpkg$ cd..
cd..: command not found
rico@rico-Aspire-5750G:/var/lib/dpkg$ cd ..
rico@rico-Aspire-5750G:/var/lib$ cd ..
rico@rico-Aspire-5750G:/var$ cd ..
rico@rico-Aspire-5750G:/$ ^V
: command not found
rico@rico-Aspire-5750G:/$ cd /var/lib/dpkg/info
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|SHA256SUM_TGZ="2ef49c97ddcd5e0de20226eea4cca7b0d7de63ddec80eff8291513f6474ca0dc"|SHA256SUM_TGZ="2cdaf0ff92d0829b510edd883a4ac8322c02f2fc1beae95d048b6716076bc014"|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|SHA256SUM_TGZ="1c6d783a54fcc0673ed1f8c5e8650b1d8977ca3e856a03fba0090198e0f16f6d"|SHA256SUM_TGZ="2cdaf0ff92d0829b510edd883a4ac8322c02f2fc1beae95d048b6716076bc014"|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|JAVA_VERSION_MAJOR=9|JAVA_VERSION_MAJOR=9.0.1|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|JAVA_VERSION_MINOR=181|JAVA_VERSION_MINOR=11|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|J_DIR=jdk-9|J_DIR=jdk-9.0.1|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|FILENAME=jdk-${JAVA_VERSION_MAJOR}+${JAVA_VERSION_MINOR}_linux-${dld}_bin.tar.gz|FILENAME=jdk-${JAVA_VERSION_MAJOR}_linux-${dld}_bin.tar.gz|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo sed -i 's|PARTNER_URL=http://download.java.net/java/jdk${JAVA_VERSION_MAJOR}/archive/${JAVA_VERSION_MINOR}/binaries/$FILENAME|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}+${JAVA_VERSION_MINOR}/$FILENAME|' oracle-java9-installer.*
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ sudo apt-get install oracle-java9-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java9-installer is already the newest version (9.0.1-1~webupd8~0).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up java-common (0.56ubuntu2) ...
mkdir: cannot create directory ‘/etc/.java/.systemPrefs’: File exists
dpkg: error processing package java-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java9-installer:
 oracle-java9-installer depends on java-common (>= 0.24); however:
  Package java-common is not configured yet.

dpkg: error processing package oracle-java9-installer (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    dpkg: dependency problems prevent configuration of openjdk-9-jre-headless:amd64:
 openjdk-9-jre-headless:amd64 depends on java-common (>= 0.28); however:
  Package java-common is not configured yet.

dpkg: error processing package openjdk-9-jre-headless:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ca-certificates-java:
 ca-certificates-java depends on openjdk-7-jre-headless (>= 7~u3-2.1.1~pre1-1) | java7-runtime-headless; however:
  Package openjdk-7-jre-headless is not installed.
  Version of openjdk-7-jre-headless on system, provided by oracle-java9-installer:amd64, is <none>.
  Package java7-runtime-headless is not installed.
  Package oracle-java9-installer which provides java7-runtime-headless is not configured yet.
  Package openjdk-9-jre-headless:amd64 which provides java7-runtime-headless is not configured yet.

dpkg: error processing package ca-certificates-java (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 java-common
 oracle-java9-installer
 openjdk-9-jre-headless:amd64
 ca-certificates-java
E: Sub-process /usr/bin/dpkg returned an error code (1)
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ 


---

  Errors were encountered while processing:
 java-common
 oracle-java9-installer
 openjdk-9-jre-headless:amd64
 ca-certificates-java
E: Sub-process /usr/bin/dpkg returned an error code (1)
rico@rico-Aspire-5750G:/var/lib/dpkg/info$ 
 plof plof

答案1

我建议您花点时间了解更多有关可用的不同 Linux 发行版以及它们用于运行或操作的内容。Ubuntu 是 Debian 的衍生产品,因此使用文件.deb来安装应用程序和程序,而.rpm我看到您尝试在 Ubuntu 上安装的文件适用于 RHEL(Redhat Enterprise Linux)及其衍生产品,如 CentOS、Fedora 等。

.rpm您的问题是您尝试在 Ubuntu 系统上安装文件,这就像尝试.exe在 Ubuntu 上安装 Windows 文件一样。请查找这些应用程序的 Ubuntu 版本(应以扩展名结尾).deb并安装它们。

java 9对于初学者来说,要在 Ubuntu 上安装,请按照以下步骤操作:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt install oracle-java9-installer

要将其设置为默认值:

sudo apt install oracle-java9-set-default
java -version

相关内容