Ubuntu – Error when creating debain source package with dpkg

dpkgerror handlingpackaging

When entering this dpkg-source -b <packagename> into the terminal to create a debian source package, I get the following error:

dpkg-source: error: syntax error in ResolutionX_1.0-0/debian/control at line 9:
first block lacks a source field

What does this mean?

My debian control file contains:

Package: ResolutionX
Version: 1.0-0
Section: base
Priority: optional
Architecture: all
Build-Depends: debhelper (>= 9)
Maintainer: xx 
Description: ResolutionX
    A simple tool to enable you to have your desired resolution without requiring graphics drivers.

Best Answer

Package: ResolutionX
Version: 1.0-0
Section: base
Priority: optional
Architecture: all
Build-Depends: debhelper (>= 9)
Maintainer: First_name Last_name 
Description: ResolutionX
    A simple tool to enable you to have your desired resolution without requiring graphics drivers.

This paragraph is a mish-mash of fields for source and binary packages. The first paragraph should describe the source package. Here, that would mean the first line has Source: instead of Package:. You can only specify Build-Depends for source packages, and Architecture for binary packages. The Version is derived from debian/changelog, and is not specified in debian/control.

I don't know how the rest of debian/control looks like, but just from this, I think you should split up the first paragraph:

Source: resolutionx
Version: 1.0-0
Section: base
Priority: optional
Build-Depends: debhelper (>= 9)
Maintainer: First_name Last_name 

Package: resolutionx
Section: base
Priority: optional
Architecture: all
Description: ResolutionX
 A simple tool to enable you to have your desired resolution   

Also note that packages are not supposed to have capital letters in their name. Indeed, packages to submitted to the Debian or Ubuntu repositories cannot have capital letters in their names.