# install deb build tools
sudo apt-get install build-essential fakeroot dpkg-dev devscripts
# download the source code
apt-get source package
# install other packages needed to build
sudo apt-get build-dep package cd package
# update the version in the changelog
dch -i
# make any changes to the source
# e.g. vim debian/rules
# then build the new package
dpkg-buildpackage -rfakeroot -uc -b
#install the package
cd .. sudo dpkg -i package.deb