Fedora 35にnginxをアンインストールする方法

環境情報
# cat /etc/redhat-release
Fedora release 35 (Thirty Five)

操作方法
1.nginxバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# nginx -v
nginx version: nginx/1.20.1
# nginx -v nginx version: nginx/1.20.1
# nginx -v
nginx version: nginx/1.20.1

2.nginxサービスを停止します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo systemctl status nginx
# sudo systemctl stop nginx.service
# sudo systemctl status nginx # sudo systemctl stop nginx.service
# sudo systemctl status nginx
# sudo systemctl stop nginx.service

3.nginxファイルを削除します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo systemctl disable nginx.service
# sudo rm -rf /etc/nginx
# sudo rm -rf /var/log/nginx
# sudo rm -rf /var/cache/nginx/
# sudo rm -rf /usr/lib/systemd/system/nginx.service
# sudo systemctl disable nginx.service # sudo rm -rf /etc/nginx # sudo rm -rf /var/log/nginx # sudo rm -rf /var/cache/nginx/ # sudo rm -rf /usr/lib/systemd/system/nginx.service
# sudo systemctl disable nginx.service
# sudo rm -rf /etc/nginx
# sudo rm -rf /var/log/nginx
# sudo rm -rf /var/cache/nginx/
# sudo rm -rf /usr/lib/systemd/system/nginx.service

4.nginxをアンインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo yum remove nginx
削除しました:
gperftools-libs-2.9.1-2.fc35.x86_64 nginx-1:1.20.1-8.fc35.x86_64 nginx-mimetypes-2.1.53-2.fc35.noarch
# sudo yum remove nginx 略 削除しました: gperftools-libs-2.9.1-2.fc35.x86_64 nginx-1:1.20.1-8.fc35.x86_64 nginx-mimetypes-2.1.53-2.fc35.noarch
# sudo yum remove nginx
略
削除しました:
  gperftools-libs-2.9.1-2.fc35.x86_64                 nginx-1:1.20.1-8.fc35.x86_64                 nginx-mimetypes-2.1.53-2.fc35.noarch

5.nginxバージョンを確認します
# nginx -v
-bash: /usr/sbin/nginx: そのようなファイルやディレクトリはありません

Fedora 35

Posted by arkgame