4

Installing nginx using "apt-get install nginx" seems to install 1.2.1, however examining the repository, it looks like both 1.6.2 and 1.9.2 are available:

http://mirrordirector.raspbian.org/raspbian/pool/main/n/nginx/

How do I tell apt to install the newer versions? If those versions are not available, why are they there?

I'm more of a CentOS person than a Debian one, so apt is still a bit foreign to me...

EDIT:

I tried downloading the .deb and using dpkg to install it but I get a tonne of dependency problems...

root@raspberrypi:~/nginx# dpkg -i nginx-full_1.9.2-1_armhf.deb
Selecting previously unselected package nginx-full.
(Reading database ... 73404 files and directories currently installed.)
Unpacking nginx-full (from nginx-full_1.9.2-1_armhf.deb) ...
dpkg: dependency problems prevent configuration of nginx-full:
 nginx-full depends on libgd3 (>= 2.1.0~alpha~); however:
  Package libgd3 is not installed.
 nginx-full depends on libpcre3 (>= 1:8.35); however:
  Version of libpcre3:armhf on system is 1:8.31-2rpi2.
 nginx-full depends on libssl1.0.0 (>= 1.0.2~beta3); however:
  Version of libssl1.0.0:armhf on system is 1.0.1e-2+rvt+deb7u17.

dpkg: error processing nginx-full (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 nginx-full
User98764431
  • 569
  • 1
  • 19
  • 33
Nick
  • 141
  • 1
  • 5

2 Answers2

8

The jessie-backports contain a precompiled armhf binary of the latest nginx mainline (1.9.10).

### add jessie-backports to sources.list
echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list.d/jessie-backports.list

### optionally add sources, as well ... it's GNU after all :)
echo "deb-src [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list.d/jessie-backports.list

### refresh
apt-get update

### install it from backports
apt-get -t jessie-backports install nginx
Robin479
  • 181
  • 1
  • 4
1

It looks like you will have to upgrade your dependencies as well.

Try sudo apt-get update && sudo apt-get install libssl1.0.0 libgd3 libpcre3 As you can see, you need libssl1.0.0 (>= 1.0.2~beta3), libgd3 (>= 2.1.0~alpha~), libpcre3 (>= 1:8.35) and then try installing it again by dpkg.

If it doesn't install latest packages you need, you can install dependencies by finding corresponding .deb files from repository one by one or use gdebi nginx-full_1.9.2-1_armhf.deb to install this package along with its dependencies. Please note that dependencies will only get installed if it's available otherwise you will have to take a long route to compile all of them from their sources.

Hope it helps.

dhruvvyas90
  • 2,883
  • 3
  • 21
  • 33