How to backup the installed package/RPM on Linux?

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".

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to restrict direct root access in Linux

We can do it just in two steps. Step One: At first we will create new root user as follows (for...

How to extract .tar.gz files in Linux/UNIX OS

A tarball is a group of files that are bundled together using the tar command. Use the...

How to add welcome message when SSH start?

You need to change the contents of /etc/motd. Unfortunately, by default, /etc/motd is a link to...

How to change root password when SSH logged in

Run the following command: passwd Now type your new passwordOnce done, retype new passwordDone!...

How to install Pinguzo on any Linux/UNIX OS

Login to Pinguzo panel using Softaculous account or create an account of Pinguzo To add new...