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
| 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)


$ sudo apt-get upgrade -s
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
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.

  • I assume you are trying to install from your local repository. am i correct?
    – Anwar
    Jun 17, 2012 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. Jun 17, 2012 at 17:17
  • I have no idea. trying to see what is happening
    – Anwar
    Jun 17, 2012 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. Jun 17, 2012 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. Jun 17, 2012 at 17:49

1 Answer 1


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.

  • 1
    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. :) Jun 17, 2012 at 18:16

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.