在Debian系统中更新LNMP(Linux, Nginx, MySQL/MariaDB, PHP)组件版本,可以按照以下步骤进行:
更新系统包列表:
sudo apt update
sudo apt upgrade -y
更新Nginx:
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:nginx/stable
sudo apt update
sudo apt install nginx -y
sudo systemctl restart nginx
更新MySQL/MariaDB:
sudo apt install mysql-server -y
sudo mysql_secure_installation
sudo apt install mariadb-server -y
sudo mysql_secure_installation
更新PHP:
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install php-fpm php-mysql php-cli php-curl php-gd php-mbstring php-xml php-zip -y
sudo systemctl restart php7.4-fpm # 根据你的PHP版本调整
验证更新:
nginx -v
mysql --version # 对于MySQL
# 或者
mariadb --version # 对于MariaDB
php -v
注意事项:
通过以上步骤,你可以顺利地在Debian系统中更新LNMP组件版本。