نسخه فارسی | English Version
This guide explains how to build your Debian package locally and publish it to GitHub Releases for submission.
Note: Any team member can build the package, but coordinate to ensure you're working with the latest code!
sudo apt-get update
sudo apt-get install -y devscripts debhelper build-essentialFrom your project root directory:
debuild -us -ucThis creates the .deb file in the parent directory:
ls ../*.deb
# Output: ../yourproject_1.0-1_all.deb# Install it
sudo dpkg -i ../yourproject_*.deb
# Test it works
yourproject # Replace with your actual command name
# Check installed files
dpkg -L yourproject
# View man page
man yourproject
# Uninstall when done testing
sudo apt remove yourprojectNote: Designate one team member to create the release, or coordinate to avoid creating duplicate releases.
-
Push your team's code to GitHub:
git add . git commit -m "Final version for submission" git push origin main
-
Go to your repository on GitHub
-
Click on "Releases" (right sidebar)
-
Click "Create a new release"
-
Fill in the release form:
- Tag version:
v1.0(or match your version in debian/changelog) - Release title:
v1.0 - Initial Release - Description: Brief summary of what your team's tool does and list team members
- Attach files: Drag and drop your
.debfile
- Tag version:
-
Click "Publish release"
# Install GitHub CLI (first time only)
sudo apt install gh
# Login to GitHub
gh auth login
# Create a release and upload your .deb
gh release create v1.0 \
--title "v1.0 - Initial Release" \
--notes "Our team's bash tool packaged as .deb" \
../yourproject_*.deb- Go to your repository's Releases page
- You should see your release with the
.debfile attached - Click the
.debfile to verify it downloads correctly - Have all team members verify the release
- Copy the release URL and submit it for grading
If your team needs to make changes:
-
Update the version in
debian/changelog:dch -i # This opens an editor to add a new changelog entry -
Rebuild the package:
debuild -us -uc
-
Create a new release (e.g.,
v1.1) with the new.debfile
- Renamed all files from
mytoolto your project name - Updated all
debian/files with your project name - Package builds without errors
- Package installs successfully with
dpkg -i - Your tool works when installed (your command runs, not
mytool!) - Man page is accessible (
man yourproject, notman mytool!) - Updated
debian/controlwith team name/representative - Updated
debian/changelogwith team information - All team members have reviewed the code
-
.debfile is uploaded to a GitHub Release - All team members have verified the release
- Release URL submitted for grading
This is normal with -us -uc flags (unsigned). These flags skip GPG signing, which is fine for learning.
Check that files listed in debian/install actually exist in your project and have the correct names.
Verify:
debian/installputs the script inusr/bin/yourcommand(no leading/)- Your script has execute permissions:
chmod +x src/yourproject.sh - Check with a team member if they modified the installation paths
Make sure you're uploading the .deb from the parent directory (../), not from inside your project.
Coordinate with your team! Use branches and pull requests to avoid conflicts in debian/ files.
You missed some files! Check:
debian/control(Source and Package fields)debian/changelog(first line)debian/install(all paths)debian/manpages(man page path)- Man page content (
.THline and throughout) - Config file paths
# Build package
debuild -us -uc
# Install package (replace 'yourproject' with your actual name)
sudo dpkg -i ../yourproject_*.deb
# Test package
yourproject # Your command
man yourproject # Your man page
# Remove package
sudo apt remove yourproject
# Create GitHub release (with gh CLI)
gh release create v1.0 --title "Release v1.0" ../yourproject_*.deb- Test early, test often - Don't wait until the last minute to build and test your package
- Use meaningful commit messages - This helps track what changed and when
- Document your tool - Good documentation in the man page and README helps users (and graders!)
- Coordinate with your team - Regular communication prevents conflicts and duplicated work
- Keep backups - Make sure your code is pushed to GitHub regularly
Good luck with your submission! 🚀