Has anyone here had some experience creating a Debian / Ubuntu package? I am trying to backport the lammps package (http://packages.ubuntu.com/quantal/lammps) from Ubuntu 12.10 (Quantal) to Ubuntu 12.04

I only need it unofficially - just need a .deb package for convenience's sake when creating custom virtual machine images for deployment to IaaS platform.

Following the Ubuntu Packaging Guide at https://wiki.ubuntu.com/PackagingGuide , I can build successfully, except when I try to rebuild using the debuild command, I usually get this error:

 dpkg-source: error: aborting due to unexpected upstream changes, see
 /tmp/lammps_0~20120615.gite442279-1.diff.aie32n dpkg-source: info: you
 can integrate the local changes with dpkg-source --commit
 dpkg-buildpackage: error: dpkg-source --include-binaries -i -b
 lammps-0~20120615.gite442279 gave error exit status 2

Running 'make clean-all' at the src directory still does not solve the problem. Is there any way to completely clean off all the files that were generated during the build process, or to ask debuild to ignore any differences in the source files?


This means you have applied changes to the unpacked upstream source which are not part of a patch in the debian/patches/ directory, or listed in the series file in there if they are; and/or there is some inconsistency in the state of quilt's application of the patches.

Looking at the mentioned file in /tmp will show you the changes in question.

  • Thank you very much for the quick answer!Is there a quick way to restore the changes done by 'make' instead of undoing all the changes record in the /tmp/*diff* file?
    – hanxue
    Dec 8 '12 at 9:08

Avoid the Debian bureaucracy by just building the binary: dpkg-buildpackage -b

  • 2
    This is not so useful if you intend to upload to debian.
    – jeremiah
    Jul 13 '17 at 22:22
  • 7
    @jeremiah but very useful if you're tweaking a debian package for personal use.
    – Wyatt Ward
    Jan 8 '18 at 20:28

change the format in debian/source/format from 3.0 (quilt) to 3.0 (native) if you do not want to use quilt. This solved the problem for me anyway.

  • THIS! Quilt is impossible. Apr 10 '15 at 19:47
  • 1
    I naively followed this comment as is. The net effect will be that your build will no longer use the patches in debian/patches. Could you please expand on the answer by explaining how you add the necessary magic to debian/rules to actually apply the patches? Apr 14 '15 at 19:39

@Thomas Vander Stichele

I have come up with a workaround that uses the generated temporary file as a patch: https://www.theo-andreou.org/?p=1112#toc-apply-patches-for-policy-compliance


I saw this problem when quilt incorrectly thought I had applied patches to my working copy (you can find its current status in the .pc folder). The fix in that case was to force quilt to pop all the patches with quilt pop -a -f.


This may happen if you did all the Debian "paperwork" but happened to have lingering artifacts from previous attempts. In particular, auto-generated changes to “config.sub”, “config.guess” and “Makefile”.

You could put this in debian/source/options:

# Don't store changes on autogenerated files
extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"

Ref: https://raphaelhertzog.com/2011/01/28/3-ways-to-not-clutter-your-debian-source-package-with-autogenerated-files/



Configure often modifies the source tree, you can list these files in


Example debian/clean


This issue usually appears during subsequent building of debian packages, although you may or may not have made changes to the original source during the first build. During the first time build, dpkg-source creates a <package-source>.orig.tar.{xz, gz, lzma} in the top-level directory. For eg. in the case of libva, you would find it as:

├── libva
├── libva_2.11.0.orig.tar.xz

Now when you make changes inside libva/ or try to build subsequent times, it unpacks this source tar.gz and tries to compare with the new build files, finding changes in the new build.

The solution is to remove the older source tar, create a new one for the subsequent build using:

dh_make --createorig -p libva_2.11.0

And continue building the deb pkgs using the commands that you have been doing. Usually it would be:

debuild -d -uc -us


dpkg-buildpackage -b -uc -us

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.