Getting source code for package in Ubuntu
Open
/etc/apt/sources.list
and uncomment
deb-src
lines of respective repositories
Don't forget to retrieve the updated package lists:
sudo apt update
Install
dpkg-dev
:
sudo apt-install dpkg-dev
Go to your ~ folder and download the source (htop for example):
sudo apt source htop