You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04虚拟机中安装xgraph时提示“E: Unable to locate package xgraph”的解决求助

Ubuntu 20.04虚拟机中安装xgraph时提示“E: Unable to locate package xgraph”的解决求助

Hey there! I totally get how frustrating it is when you're trying to set up tools for ns2 and hit that "package not found" error. Let's walk through how to fix this step by step—since xgraph isn't available in Ubuntu's default repositories, we'll need to compile it from source, which is pretty straightforward for this tool.

First, let's make sure we have all the dependencies needed to compile software. Open up your terminal and run this command to install essential build tools and X11 libraries (xgraph relies on these for its GUI):

sudo apt-get update && sudo apt-get install gcc make libx11-dev libxaw7-dev

Next, grab the xgraph source code. The most commonly used version for ns2 is xgraph-12.2. Once you've downloaded the tar.gz package, extract it with:

tar -xzf xgraph-12.2.tar.gz

Move into the extracted directory:

cd xgraph-12.2

Now configure the build environment. Run this command—if it completes without errors, we're good to go:

./configure

Compile the source code:

make

Finally, install the compiled binary system-wide so you can run it from any terminal:

sudo make install

To check if it worked, just type xgraph in your terminal. If a blank xgraph window pops up, you're all set to use it with ns2!

A quick note: Some custom ns2 distributions actually include xgraph in their package, so if you installed ns2 from a pre-built bundle, double-check its directory structure—you might already have it and just need to add it to your PATH.

备注:内容来源于stack exchange,提问作者Pooja Harihar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 15:58:15