Copy Linux Binaries From One Linux System to Another using Exodus?


Transferring Linux binaries from one system to another can be a challenging and time-consuming task, especially when you need to install the software on multiple machines. However, there is a tool available that simplifies this process - Exodus. It is a powerful tool that allows you to export and import software packages, including binaries and their dependencies, from one Linux system to another.

In this article, we will explore the steps involved in using Exodus to copy Linux binaries from one system to another. We'll cover essential steps such as identifying the location of binaries and dependencies, creating an archive file, and installing software on the target system. Additionally, we'll discuss potential issues that may arise while copying binaries across different architectures and provide useful tips to address them.

Whether you are a system administrator responsible for managing multiple Linux systems or a developer looking to distribute software updates, Exodus can be an invaluable tool in your toolkit. With its powerful features and ease of use, it can help you save time and effort while ensuring that your software is installed correctly on all target systems.

To use Exodus, you need to install the tool on both the source and target systems. Typically, Exodus is not included in most Linux systems by default, so you need to install it using your distribution's package manager. For instance, you can install Exodus by running the command 

sudo apt-get install exodus

Here's what the Linux terminal output might look like when running the sudo apt-get install exodus command −

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
   libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5widgets5 libssl1.1 libxml2 exodus-gui
Suggested packages:
   exodus-doc exodus-tests
The following NEW packages will be installed:
   exodus exodus-gui libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5widgets5 libssl1.1 libxml2
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,872 kB of archives.
After this operation, 23.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

The output shows that the exodus package will be installed. The user is prompted to confirm the installation by typing "Y" or "n" in the terminal.

After installing Exodus on both systems, you are ready to proceed with exporting and importing software packages using the tool.

Exporting Linux Binaries using Exodus

To utilize Exodus for exporting a software package, you must initially locate the binary file and its corresponding dependencies on the source system. Once you have identified their location, you can use the exodus export command to generate an archive of the software package.

For instance, suppose you intend to export the binary file htop from the source system. In that case, you can execute the following command to initiate the export process:

sudo exodus export /usr/bin/htop

After executing the command output may look like this −

Exporting /usr/bin/htop...
Creating Exodus container...
Exporting binary...
Creating tarball...
Copying tarball to host...
Export complete.
The Exodus container has been saved to:
/tmp/exodus-htop.tar.gz

After executing the command, a new archive file named htop.tar.gz will be generated in the current directory. The archive file encompasses the htop binary along with all the necessary dependencies required for its operation. This allows for a seamless transfer of the software package to another Linux system.

Importing Linux Binaries using Exodus

After transferring the archive file to the target system, you can proceed to import the software package using the Exodus import command. This command extracts the contents of the archive file and installs the software package on the target system.

As an illustration, assume that you have transferred the htop.tar.gz archive file to the target system. To import the software package from one system to another then execute the following command:

sudo exodus import htop.tar.gz

Output of the exodus command looks like this −

Importing package htop.tar.gz...
Extracting package files...
Installing package...
Package htop has been imported successfully.

This will extract the htop binary and any dependencies from the archive file and install them in the appropriate directories on the target system.

Copying Linux Binaries Across Different Architectures

When transferring Linux binaries between systems with different architectures, it is essential to confirm that the software package can function on the target architecture. You may also need to manually transfer any dependencies not included in the software package.

For instance, let's assume you intend to copy the nginx binary from an x86 system to an ARM system. To determine the architecture of the nginx binary, you can use the file command as demonstrated below:

$ file nginx

Output of nginx command −

nginx: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=9c491f7eb0025b843888971f371d12a1a262fe97, stripped

According to the output, the nginx binary is designed to run as a 64-bit executable on an x86-64 architecture. Moreover, this binary won't be appropriate with an ARM system due to differences in the command set used by ARM processors.

Sometimes you need to manually copy any dependencies and some files that are not included in the software package. To do this, You can identify the dependencies or important files required by the nginx using the ldd command as shown below 

$ ldd nginx

The output of the ldd nginx command may vary depending on the system and version of nginx installed, but here is an example output 

linux-vdso.so.1 (0x00007ffc9f5c4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9a5a41d000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f9a5a1e4000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9a59e63000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9a59acc000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9a598b5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9a594f2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9a5a89d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9a592ee000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9a590d4000)

The output shows the shared libraries that nginx depends on, including their paths and memory addresses.

Conclusion

In conclusion, Exodus is a useful tool for copying Linux binaries between systems. It offers a centralized repository for software packages, allowing for easy installation and updates on multiple systems at once. Exodus supports importing packages from various sources, handling dependencies and conflicts automatically, and even allows for copying binaries across different hardware platforms.

However, it's necessary to verify that the distributions and software versions are the same before copying binaries between systems to avoid compatibility issues. If the systems have different architectures, manual copying of dependencies may be necessary. With the right precautions in place, Exodus can streamline software management tasks, improve system stability and security, and save time and effort in managing software on multiple systems. Overall, Exodus is a useful tool for copying Linux binaries as long as the necessary precautions are taken.

Updated on: 26-Jul-2023

61 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements