Common error 01

(1)apt-get:no process found

If you apt-getget an "apt-get: no process found" error message when using the command, it could be for one of the following reasons:

1. No running apt-getprocess

This error usually occurs when you try to terminate a command that is not running apt-get. If it is not running apt-get, the error message "apt-get: no process found" may appear.

2. The command being run is notapt-get

If you have entered a command that is not  apt-get recognized as  apt-get a command, this may be the cause of the above error message.

When you're trying to use a command in the terminal  apt-get to accomplish a specific task, make sure you're typing a valid  apt-get command and only execute it if you know what you need.

3. The cache is locked

 This can cause errors if  apt-get the cache is locked  . apt-get: no process foundThis usually happens when you try to run a command with the same cache in multiple terminal sessions  apt-get .

In this case, if you want to avoid the problem, you can solve it as follows:

  • Check the status of the lock:

    sudo lsof /var/lib/dpkg/lock
    
  • If the command in the previous step returns the process PID, kill the process as follows:

    sudo kill -9 <PID>
    
  • If the problem persists, check  /var/cache/apt/archives/lock the files in the root directory.

    sudo lsof /var/cache/apt/archives/lock
    
  • If the above command returns a process PID, kill the process.

    sudo kill -9 <PID>
    
  • Then try to execute  apt-get the command again.

Above are some of the possible causes of "apt-get: no process found" error message. You can look at the context in which you are receiving this error message and try to resolve the issue.

(2)“wget: command not found”

If you wgetget a "wget: command not found" error message when executing a command, it is most likely wgetnot installed. On Ubuntu systems, wget can be installed with the following command:

sudo apt-get update
sudo apt-get install wget

The first command updates the software source information, and the second command installs it wget. If it is not installed on your system apt-get, you can use the following command to install it:

sudo apt install apt-get

(3) JAVA_HOME has not been configured

If you get a "JAVA_HOME has not been configured" error message when running a Java application on your Ubuntu system, it means that you haven't set the JAVA_HOMEenvironment variable. JAVA_HOMEThe environment variable is the path to the Java installation directory.

To fix this, you can set JAVA_HOMEenvironment variables as follows:

1. Find the Java installation directory

Execute the following command in a terminal to find your Java installation directory:

sudo update-alternatives --config java

The output is similar to the following:

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java
Nothing to configure.

In the above example, the Java installation directory is /usr/lib/jvm/java-11-openjdk-amd64/.

2. Set JAVA_HOMEenvironment variables

Open /etc/environmentthe file and add the following line (

You can edit the file in terminal with /etc/environment:

sudo nano /etc/environment

This command opens the file with the nano text editor /etc/environmentand grants you superuser privileges so you can edit and save the file.

In the opened file, move the cursor to the end of the file and add the following line:

):

JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"

The above path should be the Java installation directory you found in the first step, make sure the path matches the actual situation.

Then, use sourcethe command to make the changes take effect immediately:

source /etc/environment

 3. VerificationJAVA_HOME

Verify that the settings are correct with the following command JAVA_HOME:

echo $JAVA_HOME

If this command outputs your Java installation directory, you have successfully set JAVA_HOMEthe environment variable.

Now you can run your Java application normally.

(3) When starting WeBASE-Front, the environment that has been configured in step (2) still has this problem:

If  the error bash start.sh still occurs when  running JAVA_HOME has not been configured , then the possible cause is that  the environment variable start.sh is not correctly recognized in the script  JAVA_HOME . In this case, you can manually  start.sh set  JAVA_HOME the variable for the script. You can  start.sh add the following lines to the file:

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

The path here should be the one you found when looking for the Java installation directory. Make sure the path matches the actual situation.

After adding this line, rerun  bash start.sh the command and check if  JAVA_HOME has not been configured the error still shows up.

Specific steps are as follows

You can open the file with nano editor  start.sh to add lines. In a terminal, execute the following command:

sudo nano start.sh

This command opens  start.sh the file and enables you to edit it.

Find a line in the file that resembles the following code:

#!/bin/bash

# some code here

Add below this line:

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

The path here should be the one you found when looking for the Java installation directory. Make sure the path matches the actual situation.

When finished editing, use  Ctrl + X the key to save the file and close the editor. We can also save and exit the editor with the following command:

Ctrl + X
Y
Enter

Now that you have  start.sh added  JAVA_HOME the setting of the environment variable to the file, try running  bash start.sh the command again to see if the problem is resolved.

おすすめ

転載: blog.csdn.net/weixin_61275790/article/details/131252489
01-