Ubuntu uninstall nginx,包括重新安装

方法一:
# Run these commands as your normal login (e.g. "michael")
# Remove any existing versions of nginx
sudo apt-get remove '^nginx.*$'

# Setup a sources.list.d file for the nginx repository
cat << 'EOF' | sudo tee /etc/apt/sources.list.d/nginx.list
deb http://nginx.org/packages/ubuntu/ precise nginx
deb-src http://nginx.org/packages/ubuntu/ precise nginx
EOF

# Add nginx key
curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add -

# install nginx
sudo apt-get update && sudo apt-get -y install nginx


方法二:
rm -rf /etc/nginx
rm -rf /usr/sbin/nginx
rm /usr/share/man/man1/nginx.1.gz
apt-get remove nginx* (apt-get remove --purge nginx)

sudo apt-get remove nginx #Removes all but config files.
sudo apt-get purge nginx #Removes everything.


重新安装:

To recreate it, first uninstall using purge to remove even configuration files and records:

apt-get purge nginx nginx-common nginx-full

then reinstall:

apt-get install nginx

if above doesn't work for you

You can also try using --force-confmiss option of dpkg.

sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值