How to Copy All Packages from One Server to Another


This article provides a guide for how to copy all packages from one server to another. This could be helpful for many applications, such as running a development server, preparing a server for migration, setting up a cluster, and so forth.

How to Copy All Packages from One Server to Another

This guide assumes you are dealing with servers which are running the same OS and version.

To copy all packages from one server to another, follow the steps below:

  1. SSH your existing server as root.
  2. Run the following command:
    rpm -qa --qf "%{NAME}\n" > rpmlist.txt
    This will save the package list in a file called 'rpmlist.txt'.
  3. Copy this file to your new server.
  4. From the new server, run the following command, assuming you copied the file to the same location on the new server:
    dnf install `cat rpmlist.txt|tr '\n' ' '`
  5. Confirm the installation task to begin installing the packages.

Conclusion

You now know how to copyall packages form one server to another using command line interface.

  • server setup, server guides, configure server, package installation
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Forcefully Delete an IP Address from SolusVM

If at any point you find you have an orphaned ipaddress, you can delete it by running the...

Do You Offer a Hardware Firewall Solution?

Yes, we have a very limited selection of hardware firewalls available. We appreciate the specific...

View Server PHP Environment with phpinfo.php

The phpinfo() function outputs a huge amount of information about the system you're using, such...

How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS system. The sudo...

How to Use Sudo

This article provides a guide to using a Sudo user on CentOS server. From the command line,...