Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need nginx compiled with a special flag, so I grabbed the source from the nginx stable PPA (apt-get source), changed debian/rules, built it and packaged it with debuild/dpkg-buildpackage, and installed the necessary .debs -- so far so good.

Only now APT wants to switch my local package with the one from the repository. This is a little puzzling since both packages have the exact same version:

$ dpkg -l nginx-full
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                    Version                                 Description
+++-=======================================-=======================================-==============================================================================================
ii  nginx-full                              1.2.1-0ubuntu0ppa1~precise              nginx web/proxy server (standard version)

and

$ sudo apt-get upgrade -s
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  nginx-full
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst nginx-full [1.2.1-0ubuntu0ppa1~precise] (1.2.1-0ubuntu0ppa1~precise Stable:12.04/precise [amd64])
Conf nginx-full (1.2.1-0ubuntu0ppa1~precise Stable:12.04/precise [amd64])

Why exactly is this happening, and what's the best way of stopping it? Ideally, APT should offer to upgrade my package only with a strictly newer version, which would be a cue for me to rebuild my patched version with the newest source.

I've come across this bug report which looks pretty relevant, but since it contained no satisfactory work-around, I'm leaving the question open.

share|improve this question
    
I assume you are trying to install from your local repository. am i correct? –  Anwar Shah Jun 17 '12 at 16:59
    
The package has been installed directly from a .deb, using dpkg -i. Don't know if you would consider that a local repository. –  Tin Tvrtković Jun 17 '12 at 17:17
    
I have no idea. trying to see what is happening –  Anwar Shah Jun 17 '12 at 17:25
    
If the proposed package name has ppa1 in it, as all versions shown above do, it isn't in one of the main repositories. Have you added anyone else's PPA to work on this problem? The next version from the main repository will be 1.2.1-0ubuntu0, or higher. –  John S Gruber Jun 17 '12 at 17:36
    
@JohnSGruber: Yeah, I've added the ppa:nginx/stable PPA, so I could get the newest source package. This added both a deb and a deb-src entry. If I comment out the deb entry apt-get stops offering to upgrade my package, and I can still fetch the newest source, but I won't get notified when a new version is uploaded to the PPA. –  Tin Tvrtković Jun 17 '12 at 17:49

1 Answer 1

up vote 2 down vote accepted

You manage what gets updated by what using the version number, which is set from whatever is the top line in debian/changelog in the source package when the package is built into a deb. If you want a different version from what is in the PPA you need to set your own version number greater than what is in the PPA.

As a word of caution, note that 1.2.3-1ppa1~2 is less than 1.2.3-1ppa1, so apt-get upgrade would upgrade to 1.2.3-1ppa1. (There's magic in the "~", it is less than anything, including the end of the version number. I see you and the PPA have this symbol in your package version number.

share|improve this answer
    
This is the approach I ended up taking. Coming from a non-Linux/Debian/Ubuntu background, I found it interesting the changelog file wasn't purely descriptive, but actually parsed and used in the build process. For completeness' sake, I'll mention I used dch -v <new version> to update the change log. Also an interesting tidbit about the special "~" sign, thanks for that. :) –  Tin Tvrtković Jun 17 '12 at 18:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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