,

How to Resolve “netstat: command not found” Error When Restarting XAMPP on Linux

Posted by

Introduction

While working with XAMPP on Linux, you might encounter the following error message when trying to restart the XAMPP services:

/opt/lampp/share/xampp/xampplib: line 22: netstat: command not found

This error occurs because the netstat command, which is part of the net-tools package, is not installed on your system. This tutorial will guide you through resolving this error by installing the necessary tools.

Error Message

Here is the complete error message you might see:

Restarting XAMPP for Linux 8.2.4-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.
XAMPP: Starting Apache.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
/opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
XAMPP: Starting MySQL.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
XAMPP: Starting ProFTPD.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.

Solution

To resolve this issue, follow these steps:

Step 1: Update Package List

First, update your package list to ensure you have the latest information on available packages:

sudo apt-get update

Step 2: Install net-tools

The netstat command is part of the net-tools package. Install it using the following command:

sudo apt-get install net-tools

Step 3: Verify Installation

To confirm that netstat has been installed correctly, run:

netstat -version

You should see the version information for netstat, indicating that it is now available on your system.

Step 4: Restart XAMPP

After installing net-tools, restart XAMPP to ensure that the error is resolved:

sudo /opt/lampp/lampp restart

You should see output similar to the following, without the netstat: command not found error:

Restarting XAMPP for Linux 8.2.4-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

Conclusion

By following these steps, you can resolve the netstat: command not found error when restarting XAMPP on Linux. Installing the net-tools package provides the necessary netstat command, ensuring that XAMPP can function correctly without any issues.


0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x