Blog / Linux/ Complete Guide to Uninstalling ProFTPD in an LNMP Environment

Complete Guide to Uninstalling ProFTPD in an LNMP Environment

LNMP 环境下 ProFTPD 的完整卸载指南

How to Uninstall ProFTPD in an LNMP Environment

If you need to remove ProFTPD after installing it in an LNMP (Linux, Nginx, MySQL, PHP) stack, follow the steps below according to your operating system. Important: Ensure the ProFTPD service is stopped before proceeding.

1. Debian/Ubuntu Systems

For Debian-based systems (e.g., Ubuntu), use the following commands:

# Stop the service
sudo systemctl stop proftpd
# Disable auto-start on boot
sudo systemctl disable proftpd
# Remove the package and purge configuration
sudo apt-get remove --purge proftpd proftpd-*

For older systems using SysVinit, you may also run:

sudo update-rc.d -f proftpd remove

2. CentOS/RHEL Systems

For RHEL-based systems (e.g., CentOS 7/8, AlmaLinux, Rocky Linux), use these commands:

# Stop the service
sudo systemctl stop proftpd
# Disable auto-start on boot
sudo systemctl disable proftpd
# Remove the package (if installed via yum/dnf)
sudo yum remove proftpd

If you installed ProFTPD from source, manually delete the relevant files:

# Stop the service
sudo /usr/local/proftpd/sbin/proftpd stop
# Remove the installation directory
sudo rm -rf /usr/local/proftpd
# Remove the init script (if present)
sudo rm -f /etc/init.d/proftpd
# Remove configuration files (optional)
sudo rm -rf /etc/proftpd

3. Post-Uninstallation Verification and Cleanup

After uninstalling, perform these checks:

  • Verify the service is stopped: sudo systemctl status proftpd or ps aux | grep proftpd.
  • Check if the default FTP port (21) is released: sudo netstat -tlnp | grep :21 or sudo ss -tlnp | grep :21.
  • If you modified firewall rules, revert them (e.g., close port 21).

Frequently Asked Questions

Q: I get an error "/etc/init.d/proftpd: No such file or directory" when trying to remove it. What should I do?
A: This usually means ProFTPD was not installed via a system service script or was already removed. Check if it was installed from source in a different directory (e.g., /usr/local/proftpd) or if it uses a different service manager (like systemd).

Q: How can I completely clean up configuration files after uninstallation?
A: In addition to removing the package, manually delete the configuration directory (typically /etc/proftpd) and log files (usually in /var/log/proftpd) to ensure a full cleanup.

Warning: Most commands require root privileges. Use caution, especially with rm -rf, to avoid accidentally deleting critical system files.

Post a Comment

Your email will not be published. Required fields are marked with *.