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
  • The current Raspberry repo is dead, you need to add Jessie repo with pinning and you will get 1.6 or something, you can try dev repo too or compile it on your own. – Piotr Kula Jul 4 '15 at 7:21
  • Is Jessie compatible with Wheezy? – Nick Jul 6 '15 at 22:29
  • 1
    That doesn't make sense. It's like asking Walmart compatible with Tesco. They just contain lots of stuff. Both of them the same stuff but also other stuff. Also. You either do selective upgrade or just upgrade the entire distro to Jessie and get ur over with. Deb won't work either because the packages it wants are of date on Whhezy. I think the latest you can go on wheezy with Deb is 1.6.2 – Piotr Kula Jul 7 '15 at 6:18
  • As I said originally, I'm from a CentOS background so the "debian way" is a little different to what I'm used to. In CentOS if you tried to tell Yum to use the CentOS 7 repo on a CentOS 6 server, I'm fairly sure all levels of hell would break lose. There is a significant process to go through to upgrade... wiki.centos.org/TipsAndTricks/CentOSUpgradeTool – Nick Jul 7 '15 at 12:23
  • Ahh - apt-get dist-upgrade.... raspberrypi.org/forums/viewtopic.php?f=66&t=47944 – Nick Jul 7 '15 at 12:24
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
  • echo "deb ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list.d/jessie-backports.list permission denied! does it need to run as sudo? – Keith Feb 14 '17 at 23:56
  • This will only work on ARMv7 systems. If you try it on Pi A, A+, B, B+, Zero, which all run ARMv6, you will effectively brick your system (SSH breaks, WiFi authentication breaks) – Scott Stevens Jun 4 '17 at 2:28
  • Change from deb http://ftp.debian.org/debian jessie-backports main to deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main. Per this answer. – JamesThomasMoon1979 Apr 18 at 6:25
  • @JamesThomasMoon1979 - I'm not sure, but it might be better to submit a new up-to-date answer, rather than edit this one... – Greenonline Apr 18 at 7:34
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.

  • I dont understand why apt-get upgrade doesn't automatically use the latest ones though? And if I need to manually install all those things, why is there a .deb file in the repo? – Nick Jul 6 '15 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.