How to make deb or rpm packages

for Creating deb or rpm package we need to install the following services

  1. ruby
  2. gem (auto-installed with ruby)
  3. fpm
  4. package_cloud (optional)
  5. rpm-build ( For rpm package only)

For installing ruby, use this link. after that install fpm and package_cloud

gem install fpm
gem install package_cloud

Use following script for creating package

#!/bin/bash
version=`date +%Y%m%d%H%M`
PACKAGE_DIR=/usr/local/src/installer/install-builder/
POSTINSTALL_MESSAGE_SH_FILE=$PACKAGE_DIR/build/postinst.sh
rm -rf $PACKAGE_DIR/*.deb
rm -rf $PACKAGE_DIR/*.rpm
fpm --after-install $POSTINSTALL_MESSAGE_SH_FILE -s dir  -t deb -n installer -v $version -C $PACKAGE_DIR/build/hepic-installer/ -d apt-transport-https -d ca-certificates -d dirmngr -d debconf -d debconf-utils -d libboost-regex-dev -d libmariadb-dev -d libboost-program-options-dev -d libboost-date-time-dev -d libboost-thread-dev -d git -d curl -d wget -d vim -d nano -d sudo -d software-properties-common -d apt-transport-https -d libboost-iostreams-dev -d shc

fpm --after-install $POSTINSTALL_MESSAGE_SH_FILE -s dir  -t rpm -n installer -v $version -C $PACKAGE_DIR/build/hepic-installer/ -d git -d curl -d gnupg2 -d boost-regex -d wget -d vim -d nano -d sudo -d shc

mv $PACKAGE_DIR/*.deb $PACKAGE_DIR/installer_$version-amd64.deb

and for pushing the package to the packagecloud use the following script

#!/bin/bash
## PUSH
PACKAGE_DIR==/usr/local/src/installer/install-builder/
RPM_PACKAGE=$PACKAGE_DIR/installer-202211291639-1.x86_64.rpm
DEB_PACKAGE=$PACKAGE_DIR/installer_202211291639-amd64.deb
package_cloud push PACKAGE/repo-dev/el/7 $RPM_PACKAGE
package_cloud push PACKAGE/repo-dev/ol/7 $RPM_PACKAGE
package_cloud push PACKAGE/repo-dev/debian/buster $DEB_PACKAGE
package_cloud push PACKAGE/repo
-dev/debian/stretch $DEB_PACKAGE

Enjoy ;)

How to install Ruby

Go to Ruby Official Website ( https://www.ruby-lang.org/en/downloads/ ) and download the latest stable version

wget https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.3.tar.gz

Extract files

tar -xvf ruby-3.1.3.tar.gz

install some basic dependencies

  1. autoconf
  2. openssl-devel / libssl
  3. numactl
cd ruby-3.1.3
./autogen.sh
./configure --with-openssl
make
make install

Enjoy ;)

How to resize any VMs Hard disk size

Pre-Requiste First Confirm if your Linux machine was created using LVM or not, execute the following commands pvdisplay vgdisplay lvdisplay ...