要在Debian上更新Nginx版本,请按照以下步骤操作:
sudo apt update
sudo apt install nginx
nginx -v
sudo apt remove nginx
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
echo "deb http://nginx.org/packages/mainline/debian/ $(lsb_release -cs) nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
对于Debian 9(Stretch),请使用以下命令:
echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
sudo apt update
sudo apt install nginx=1.21.6-1~buster
注意:请根据你的Debian版本和需求选择合适的Nginx版本。
sudo systemctl restart nginx
nginx -v
现在,你已经成功地在Debian上更新了Nginx版本。