Question

I accidentally updated my web server today and didn't notice that Nignx has been updated to a higher version from 1.4.7 to 1.6.0. Due to this silly mistake my whole web server is down and can't run my sites anymore. I want to go back to Nginx v.1.4.7 again and pin the version so that when there is an update, it doesn't get updated till I decide myself.

now I want to know how to remove these packages: nginx-naxsi, nginx-naxsi-dbg, nginx-naxsi-ui for v.1.6.0-1, but every time I do that it tells me that there are unmet dependency(s)...

here is what I have on my server:

Nginx installed packages

or look here direct link... Nginx installed packages

and here what messages I get when I run the following remove commands:

sudo apt-get autoremove nginx
sudo apt-get --purge remove nginx
sudo apt-get autoremove && sudo apt-get autoclean
sudo find / | grep nginx | sudo xargs rm -rf

The error messages:

The following packages have unmet dependencies:
 nginx : Depends: nginx-full (< 1.4.7-1-custom.1~) but it is not going to be installed or
                  nginx-light (< 1.4.7-1-custom.1~) but it is not going to be installed or
                  nginx-extras (< 1.4.7-1-custom.1~) but it is not going to be installed or
                  nginx-naxsi (< 1.4.7-1-custom.1~) but 1.6.0-1 is to be installed
 nginx-naxsi : Depends: nginx-common (= 1.6.0-1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

And this one, too.

The following packages have unmet dependencies:
 nginx-naxsi : Depends: nginx-common (= 1.6.0-1) but 1.4.7-1-custom is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

is there a procedure that can help removing nginx-naxsi, nginx-naxsi-dbg, nginx-naxsi-ui for v.1.6.0-1??

Thanks

Was it helpful?

Solution

It's ok. I found the solution myself. all I had to do is to enter the following command lines one after another...

apt-get -f install

Then any package that is unnecessary will be either removed or updated.

After that I re-installed nginx "the new version 1.6.0" to make sure things are working fine...

so I run this command to see what packages are on:

sudo dpkg -l | grep nginx

since all necessary packages for Nginx are installed, I had to use this command to remove all at once:

apt-get remove --purge nginx-common

This way all new version 1.6.0 of Nginx are removed!!

I hope this answer is going to be useful for anyone who run into such issue.

Good luck!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top