rpmrebuild is a tool to build an RPM file from a package that has already been installed in a basic use, rpmrebuild use do not require any rpm building knowledge (On Debian, the equivalent product is dpkg-repack).
If it is not yet installed on your server install it first. For RHEL/CentOS:
yum install rpmrebuild -y
For Ubuntu/Debian:
apt-get install rpmrebuild -y
Once it will be installed, you're ready to use it! For example, the "screen" package is installed on the server, so you can use the command line to backup the "screen" package:
rpmrebuild screen
Then it will ask for confirmation, type "Y" and hit Enter. The package will be backed up on /root. At the output, you'll see the exact location of it, where the backup file was generated. If you wish to install an RPM file, execute the command line:
rpm -Uvh rpm_pack_name.rpm
Make sure to replace the exact package name with "rpm_pack_name.rpm".