I can't install ns2 in Ubuntu with the below error as shown in the picture.

enter image description here

(1) You MUST put /home/dadebidad/NS2/ns-allinone-2.35/otcl-1.14, /home/dadebidad/NS2/ns-allinone-2.35/lib, 
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries 
    If you are using csh, you can set it like:
        setenv LD_LIBRARY_PATH 
    If you are using sh, you can set it like:
        export LD_LIBRARY_PATH=

(2) You MUST put /home/dadebidad/NS2/ns-allinone-2.35/tcl8.5.10/library  
into your TCL_LIBRARY environmental  
    variable. Otherwise ns/nam will complain during startup.

Nothing is to be added to .bashrc .

The old year ~1999 text .... »» Please put .... ,, IMPORTANT NOTICES: You MUST put .. «« .. was meant only for a "University Computer" : I.e. when you had no write permissions to /usr/local/.

The executable 'ns' or "ns-[any-name]" is hard coded to know the location of it´s libraries: ns-allinone-2.35/{ lib/{libtcl*, tclConfig.sh, tcl8*/}, bin/tcsh8* }.

This will usually do : $ cd ns-allinone-2.35/ns-2.35/ && sudo make install I.e. 'make install' will copy 'ns' to /usr/local/bin/, i.e. i.e. a system PATH.

HOWTO, ns-2.35 :
tar xvf ns-allinone-2.35_gcc5.tar.gz   (The 2014 .. 2017 update)


cd ns-allinone-2.35/
cd ns-2.35/
sudo make install
cp ns ns235-orig  (This is your backup)
sudo cp ns235-orig /usr/local/bin/
cd ../nam-1.15/
sudo make install

That's it. If you add some changes or a patch, the executable 'ns235-orig' can still be used for the default examples : $ ns235-orig file.tcl


The Internal Field Separator for path variables is :. So assuming the libraries are in the locations listed in the output in your question. The following commands will properly populate the variables, if they are currently unset. The ~ should expand to your home dir.

export LD_LIBRARY_PATH=~/NS2/ns-allinone-2.35/otcl-1.14:~/NS2/ns-allinone-2.35/lib
export TCL_LIBRARY=~/NS2/ns-allinone-2.35/tcl8.5.10/library
  • I did the following. Did not conclude – Dadebidad Oct 29 '17 at 7:24
  • @Dadebidad Did you run .validate or try rerunning the command that gave the error? If so was there a new error? – J. Starnes Oct 29 '17 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.