How to solve dpkg-source source problem when building a package?
Solution 1
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.
Solution 2
Avoid the Debian bureaucracy by just building the binary: dpkg-buildpackage -b
Solution 3
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.
Solution 4
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
.
Solution 5
@Thomas Vander Stichele
I have come up with a workaround that uses the generated temporary file as a patch:
$ cp /tmp/path_to_diff_file_created_by_dpkg-source debian/patches/useful_name_of_applied_patch.patch
$ echo useful_name_of_applied_patch.patch >> debian/patches/series
Related videos on Youtube
hanxue
Updated on September 18, 2022Comments
-
hanxue almost 2 years
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?
-
Admin about 2 yearsIf "I only need it unofficially - just need a .deb package for convenience's sake" does not apply to you: Keep a large distance from the top answers. Read the answers from Stéphane Gourichon and dza down there.
-
-
hanxue over 11 yearsThank 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?
-
Jay _silly_evarlast_ Wren about 9 yearsTHIS! Quilt is impossible.
-
Thomas Vander Stichele about 9 yearsI 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?
-
jeremiah almost 7 yearsThis is not so useful if you intend to upload to debian.
-
Wyatt Ward over 6 years@jeremiah but very useful if you're tweaking a debian package for personal use.
-
bgStack15 over 2 yearsSome of us don't need to upload to debian. Sometimes even after I make an immediate tarball with
git archive --format=tar.gz --prefix=freeipa-4.9.8/ 4.9.8-1+devuan1> ../freeipa_4.9.8.orig.tar.gz
from my current branch with git status empty, I still get failures that match the OP error message. This answer lets me skip that baloney and ensure my application still builds. -
Admin about 2 yearsAlthough this answer is correct, it conflates "a package with broken clean-up policy" and "a package whose source files you are actually and intentionally modifying". The solution to the former is not overriding the original tarball, but to the latter it may be if the package is for personal use only (as the poster says).