How To Install phpmd on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
2 minutes • 380 words
Introduction
In this tutorial we learn how to install phpmd on Ubuntu.
What is phpmd
phpmd is:
PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. This project uses PHP Depend to measure several software metrics from given source code, then it compares the calculated values with customizable thresholds and reports all suspect software artifacts.
There are three methods to install phpmd on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install phpmd Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install phpmd using apt-get by running the following command:
sudo apt-get -y install phpmd
Install phpmd Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install phpmd using apt by running the following command:
sudo apt -y install phpmd
Install phpmd Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install phpmd using aptitude by running the following command:
sudo aptitude -y install phpmd
How To Uninstall phpmd on Ubuntu
To uninstall only the phpmd package we can use the following command:
sudo apt-get remove phpmd
Uninstall phpmd And Its Dependencies
To uninstall phpmd and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove phpmd
Remove phpmd Configurations and Data
To remove phpmd configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge phpmd
Remove phpmd configuration, data, and all of its dependencies
We can use the following command to remove phpmd configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge phpmd
Dependencies
phpmd have the following dependencies:
References
Summary
In this tutorial we learn how to install phpmd package on Ubuntu using different package management tools: apt, apt-get and aptitude.