hen installing Oracle Database 11.2.0.4 on Linux x86-64, particularly SUSE12SP1, SUSE12SP2, or RHEL7, you may encounter a linking error during the installation phase:
Error in invoking target 'agent nmhs' of makefile /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
This issue typically halts the installation at the linking stage, leaving administrators confused about how to proceed.
Let’s break down the cause, symptoms, and the exact steps to fix it permanently.

Understanding the Error
During the installation of Oracle Database 11.2.0.4, Oracle runs a series of linking commands that compile and connect various internal components. This process uses makefiles — scripts that define how each Oracle binary is built.
One of those makefiles is:
$ORACLE_HOME/sysman/lib/ins_emagent.mk
This file is responsible for linking Enterprise Manager (EM) agent components, including emagent, emdctl, and nmhs.
When Oracle attempts to link these binaries, you might see this error:
Error in invoking target 'agent nmhs' of makefile /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
And in the detailed make log:
collect2: error: ld returned 1 exit status
/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk:176: recipe for target '/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/emdctl' failed
make[1]: *** [/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/emdctl] Error 1
make: *** [emdctl] Error 2
This happens at the linking stage, just before the installer finalizes database binaries.
What Causes the Error?
The root cause lies in library linking incompatibilities between Oracle Database 11.2.0.4 and newer Linux distributions such as RHEL7 and SUSE12.
Oracle 11.2.0.4 was originally released for older kernels and library versions, so certain link references inside ins_emagent.mk are outdated or incomplete for newer systems. The missing or mislinked library here is -lnnz11, which is responsible for Oracle network security services (part of Oracle Net libraries).
When the emdctl binary tries to link without the proper dependency, the linker fails, leading to the above error.
The Simple Solution
Thankfully, the fix is straightforward. You just need to edit one line in the ins_emagent.mk file and re-run the installation.
Step 1: Locate the File
Navigate to the Oracle home directory:
cd $ORACLE_HOME/sysman/lib
By default, this will be something like:
cd /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib
Step 2: Edit the Makefile
Open the file ins_emagent.mk in your preferred text editor. For example:
vi ins_emagent.mk
Search for the line that contains:
$(MK_EMAGENT_NMECTL)
This line defines the linking command for the Enterprise Manager agent control utility.
Step 3: Add the Missing Library Reference
Modify the line as follows:
Original:
$(MK_EMAGENT_NMECTL)
Updated:
$(MK_EMAGENT_NMECTL) -lnnz11
This addition explicitly includes the missing network library (-lnnz11) that the linker requires.
Step 4: Save and Retry
After saving the file, go back to the Oracle installer GUI and click Retry.
The installer will re-run the linking process, and this time, it should complete successfully.
Why Does Adding “-lnnz11” Work?
The -lnnz11 flag instructs the linker to include the Oracle Network Library (nnz), which provides SSL and encryption support. In older Linux environments, the linker automatically included this dependency, but in newer ones, it does not.
By explicitly appending -lnnz11, you ensure the linker can resolve all symbols and successfully create the Enterprise Manager binaries (emagent, emdctl, etc.).
Verifying the Fix
After clicking “Retry” and the installation completes successfully, you can verify that the binaries were built properly.
Check the existence of the emdctl binary:
ls -l $ORACLE_HOME/sysman/lib/emdctl
and the agent binary:
ls -l $ORACLE_HOME/bin/emagent
You should now see the correct files with no linking errors.
When to Expect This Error
You’re most likely to see this issue when:
- Installing Oracle Database 11.2.0.4 on newer Linux kernels (RHEL 7+, SUSE 12+).
- Performing a manual relink of Oracle binaries.
- Running Oracle setup on customized or minimal Linux builds missing legacy libraries.
This issue is not seen in Oracle 12c or later because those versions were built with updated makefiles for newer GCC and glibc versions.
Final Thoughts
The “Error in invoking target ‘agent nmhs’ of makefile ins_emagent.mk” is one of the most common Oracle 11g installation issues on modern Linux systems. Fortunately, it’s also one of the easiest to fix. By adding “-lnnz11” to the makefile and retrying the installation, you can complete your setup without reinstalling or rolling back.
This small tweak ensures compatibility between Oracle’s 11g linking scripts and the newer Linux toolchains used in distributions like RHEL7 and SUSE12SP2.
Quick Summary
| Step | Action | Command / File |
|---|---|---|
| 1 | Navigate to directory | cd $ORACLE_HOME/sysman/lib |
| 2 | Edit the makefile | vi ins_emagent.mk |
| 3 | Add library flag | Replace $(MK_EMAGENT_NMECTL) with $(MK_EMAGENT_NMECTL) -lnnz11 |
| 4 | Save and retry installation | Click Retry in Oracle installer |
| 5 | Verify success | Check $ORACLE_HOME/install/make.log and emdctl binary |
Conclusion
While Oracle 11.2.0.4 remains a reliable release, it wasn’t designed with RHEL7 and SUSE12 in mind. As Linux evolves, small incompatibilities like this become more frequent.
The good news is that Oracle’s installation framework is flexible enough to let administrators make quick adjustments — and this one-line fix in ins_emagent.mk is a perfect example.
By following this guide, you can avoid installation failures, save hours of troubleshooting, and get your Oracle environment up and running smoothly.





Comments 3