how to install NS2 on linux correctly. because many tutorials cannot be run. ask for help please yes because I'm still a beginner in using Linux Ubuntu. thank you.
You didn't give your release, but https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=ns2 shows it's available for supported releases (listing i386 architecture which is x86 [32bit]).
ie. you only
sudo apt install ns2 and if you have 'universe' enabled it'll install
If you haven't enabled 'universe' see https://help.ubuntu.com/community/Repositories/Ubuntu 'universe' is enabled by default for Ubuntu flavors (such as Lubuntu, Xubuntu..), but it enables Ubuntu community software to be added to your system; by default Ubuntu uses only Canonical software which for a LTS release has 5 years of support; 'universe' or community support can be shorter (eg. 3 years is normal for LTS releases)
I find packages.ubuntu.com really useful, not as quick as
apt-cache search from terminal, but the web engine provides releases other than my own thus is really useful here, or anytime you have a browser already open