Skip to content

Solutions for Port Conflict

Problem Phenomenon

When ROS is used to control the robotic arm under Ubuntu, "98 Address already in use" error appears, indicating that the port is occupied.

Solution

Shut down or immediately suspend the process that occupies the port, or release the occupied port.

Operation Steps

Method 1: Restart the system.

Method 2: Use the command to turn off the process that occupies the port.

  1. Open the terminal and execute the following command to query the PID of the process the occupies the port:
Linux
sudo netstat -lnp | grep 8080

or

Linux
sudo lsof -i:8080

If a process occupies 8080 port, the command line will display the detailed information about the process, as shown in the figure below.

Query results

  1. Execute the following command to turn off the target process.
Linux
sudo kill -9 PID

If the PID of the process that occupies 8080 port is 3349 or 3669, execute the following command to turn off the target process.

Linux
sudo kill -9 3349
sudo kill -9 3669

TIP

-9 represents the SIGKILL signal, to force the process to stop running immediately. Then you can use ROS to control the robotic arm normally.