Jump to content

Prefer NginX and MariaDB from other repositories (newer versions)


infinity

Recommended Posts

Hi,

 

I'm desperately trying to force my ARMBian jessie to install nginx from the following repository:

 

deb http://mirrordirector.raspbian.org/raspbian/jessie main contrib non-free rpi

 

As armbian does have only nginx 1.6.2 in its repository I would like to force updating nginx and mariadb from the mentioned repository, but whenever I try to apt-get install it, it never installs nginx 1.9.9 but 1.6.2 instead and claims it is the recent one. Although I even uncommented all the other repositories temporarily in my /etc/apt/sources.list

 

Somehow I also could not get it work with pinning, but may be I am doing something wrong.

 

What I would like to have finally:

 

  • Update system and everything else like before from the default repository
  • but force updating mariadb and nginx from the above mentioned repo. (also its dependencies)

Does somebody have any idea? I am more like a beginner to linux. But to be said... even having only the above mentioned repo in my /etc/apt/sources.list it does install older versions.

Also, when I type in:

apt-get install nginx-1.9.9 or nginx.1.9.9* 

it just says that those packages are not there.

 

When I type in 

apt-get install nginx-extras

then it again installs just 1.6.2 and claims it is the recent version. But if I open the repo in my browser I clearly see that there is also 1.9.9. But how to force it? And how to force it specifically to install only nginx and mariadb from this repo?

 

Thanks alot in advance and sorry for the more or less stupid question, but I am really desperately trying for 3 days now :/

 

Link to comment
Share on other sites

First, you are trying to install things from Raspbian repository. Packages there are compiled for different architecture, so it's a good thing you didn't manage to install anything from it.

 

Second, you were trying to install packages from Jessie (stable release), and all packages there has exact same versions as in Debian repository.

 

So, you need to install nginx from Debian testing branch, for example:

https://packages.debian.org/stretch/nginx- version 1.9.9

To do so, you need to duplicate repository entries in your sources.list, replacing "jessie" with "stretch". 

You still need to use apt pinning to prevent upgrading whole system to testing branch, or you can try downloading and installing packages manually, resolving dependencies as they appear.

Link to comment
Share on other sites

First, you are trying to install things from Raspbian repository. Packages there are compiled for different architecture, so it's a good thing you didn't manage to install anything from it.

 

Second, you were trying to install packages from Jessie (stable release), and all packages there has exact same versions as in Debian repository.

 

So, you need to install nginx from Debian testing branch, for example:

https://packages.debian.org/stretch/nginx- version 1.9.9

To do so, you need to duplicate repository entries in your sources.list, replacing "jessie" with "stretch". 

You still need to use apt pinning to prevent upgrading whole system to testing branch, or you can try downloading and installing packages manually, resolving dependencies as they appear.

Thanks for your fast reply :)

 

Well, as raspbian also bases on debian it should not be a different architecture. The armhf packages should work either. Also a week ago I somehow managed to install nginx 1.9.9 from debian unstable branch and this nginx and mariadb did not work. Then I was screwing around my system to get those raspbian packages onto it and they worked completely perfect for some days. Now I would like to find a proper way to install those raspbian packages (but only restricted to nginx and mariadb and its dependencies). The aim is that I want to use apt-get update somewhen and the system should grab nginx and mariadb automatically from raspbian repo and all the other updates from default repo. But I cant see anywhere somekind of whitelist or I simply don't know how to pin a proper way, so that only nginx is prefered.

 

Is it possible, that you give me an example?

Lets be honest: I see this how-to http://jaqque.sbih.org/kplug/apt-pinning.htmlbut I'm failing to understand how this can specifically pick nginx... it sounds all so general, but I just want something like:

apt-get update

and this automatically updates nginx from raspbian

automatically updates all others from default repos

 

 

EDIT

What do I pin to use stretch? 

 

is it like:

 

Package: *
Pin: release n=stretch
Pin-Priority: 900

or 

 

Package: nginx
Pin: release n=stretch
Pin-Priority: 900

or somehow differently?

 

 

Also I somethimes see something like this (and it should be exaclty what I need):

As far as I understand from logic thinking this should be a preferable repo especially for nginx! This would be idially for me and I would also make one for mariadb then, but it does also not work:

etc/apt/sources.list.d/nginx.list
# NGINX Repository
deb http://nginx.org/packages/mainline/debian/ jessie nginx
deb-src http://nginx.org/packages/mainline/debian/ jessie nginx

and as there is no armhf included, I thought

I could just change it into:
etc/apt/sources.list.d/nginx.list
# NGINX Repository
deb http://mirrordirector.raspbian.org/raspbian/jessie nginx

but no luck. I'm sure I am not aware of the basics, but can't find any, which explain it either :/

Link to comment
Share on other sites

First, you are trying to install things from Raspbian repository. Packages there are compiled for different architecture, so it's a good thing you didn't manage to install anything from it.

 

Second, you were trying to install packages from Jessie (stable release), and all packages there has exact same versions as in Debian repository.

 

So, you need to install nginx from Debian testing branch, for example:

https://packages.debian.org/stretch/nginx- version 1.9.9

To do so, you need to duplicate repository entries in your sources.list, replacing "jessie" with "stretch". 

You still need to use apt pinning to prevent upgrading whole system to testing branch, or you can try downloading and installing packages manually, resolving dependencies as they appear.

 

I tried your advice and replaced jessie with stretch and then added the preferences file:

Package: nginx
Pin: release n=stretch
Pin-Priority: 900

the cool thing ist: nginx installed as 1.9.9 :)

the downside: everything else also installs from stretch :/

Link to comment
Share on other sites

Well, as raspbian also bases on debian it should not be a different architecture. The armhf packages should work either. Also a week ago I somehow managed to install nginx 1.9.9 from debian unstable branch and this nginx and mariadb did not work. 

Yes, Raspbian is based on Debian, but it has its own repo because Raspberry Pi SoC (except for Raspberry Pi 2) has armv6 architecture, while RPi 2 and all boards supported by Armbian have armv7.

 

There are enough search results in Google for installing packages from testing branch with apt pinning, so I won't copypaste anything here.

For example: https://serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing

 

Just remember that you can use "-s" option for "apt-get upgrade" or "apt-get install" to see what packages and what versions are about to be installed without actually modifying your system.

Link to comment
Share on other sites

Yes, Raspbian is based on Debian, but it has its own repo because Raspberry Pi SoC (except for Raspberry Pi 2) has armv6 architecture, while RPi 2 and all boards supported by Armbian have armv7.

 

There are enough search results in Google for installing packages from testing branch with apt pinning, so I won't copypaste anything here.

For example: https://serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing

 

Just remember that you can use "-s" option for "apt-get upgrade" or "apt-get install" to see what packages and what versions are about to be installed without actually modifying your system.

 

Thanks again! My Banana has also ARM v7, thatswhy I'm looking on armhf on raspbian repo :). As this is fully compatible and I also made the experience that it worked better that unstable branch of debian repo, I am aware of this argument. Anyway, I will look deeper into your link, but on first sight it is nothing new compared to the stuff I tried to explain here. I think I just lack a bit of knowledge respecitvely experience to get it working.

 

Thanks anyway :)

Link to comment
Share on other sites

For the record:

 

Just remember that you can use "-s" option for "apt-get upgrade" or "apt-get install" to see what packages and what versions are about to be installed without actually modifying your system.

This advice is absolutely awesome :) Thank you soooo much!! I did not know how simulating an installation was possible and was frustrated everytime when I screwed my testing system...

 

Solving my original question:

 

using 

apt-cache policy

 and

apt-cache policy nginx

showed me the current pin-priority and after adding my prefered repo I could follow whether this would be considered or not. And then I just needed to setup a corresponding preferences file:

 

Package: *                      
Pin: release a=unstable          
Pin-Priority: 400             


Package: *nginx*               
Pin: release a=unstable
Pin-Priority: 600               


Package: *mariadb-server*      
Pin: release a=unstable
Pin-Priority: 600

First part lowers the priority for the whole unstable repo. The other two sections raise priority specificly for nginx and mariadb. Of course I ran into dependency problems :D with mariadb-server, but thats another story. Anyways... with your -s parameter I was able to see what is going to happen, thus solving everything I needed.

 

Thanks again zador.blood.stained

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines