简体   繁体   中英

Can one just copy perl modules from one Linux machine to another?

I have a remote CentOS server (Release 6.10) set up by someone else. I have quite a few perl modules installed on the machine.

I have set up a local CentOS server (Release 7.7.1908). I would like to have the EXACT same set of perl modules on my local machine. Installing them one by one via cpan is an option but I can run into issues as some of the perl modules are older (very) versions.

I was wondering, if I can copy modules from the remote server to my local server. Can I do that? Are there other options?

It's not safe to copy modules from one machine to another because things may not be set up identically. It's best to reinstall them.

You can use the autobundle command in the cpan shell to create a dump of all the modules you have installed on the old machine. You can then use that dump to tell the cpan shell on the new machine what modules to install.

Thanks to Polar Bear, here's a link to an article that explains how to reinstall the autobundle .

The solution suggested by Andy Lester is perhaps the best way to do it. I found a documentation here in addition to ones suggested.

In my case however this was not straight forward because the source server environment is very old and there were many dependencies that I will need to manually resolve. In general if you have similar environments and clean installs, the auto bundle approach will make it easy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM