安装 ns2 时的依赖问题

安装 ns2 时的依赖问题
Check if you are using third-party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f
Transaction failed: The package system is broken
 The following packages have unmet dependencies:

libc6: libc6-dbg: Depends: libc6 (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed
libc6-dev: Depends: libc6 (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed
           Depends: libc-dev-bin (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1.3 is installed
libc6-i386: Depends: libc6 (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed
libc6:i386: 

使用评论后

sudo apt update
sudo apt upgrade


The following packages have unmet dependencies
:libc6 : Breaks: libc6:i386 (!= 2.27-3ubuntu1) but 2.27-3ubuntu1.3 is installed 
:libc6:i386 : Breaks: libc6 (!= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed 
:libc6-dbg : Depends: libc6 (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed 
:libc6-dev : Depends: libc6 (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed 
:libc6-i386 : Depends: libc6 (= 2.27-3ubuntu1.3) but 2.27-3ubuntu1 is installed 
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)

答案1

我不知道你是如何安装的,但我会为你提供完整的下载、构建和安装说明ns2

步骤 1:ns2从链接下载https://sourceforge.net/projects/nsnam/files/latest/download

/home/user_name第 2 步:在called中新建一个目录ns2,并将下载的文件复制ns-allinone-2.35.tar.gz到此目录。

步骤 3:更新软件包列表

sudo apt update

步骤 4:更新一些依赖项(包/库)

sudo apt install build-essential autoconf automake libxmu-dev
sudo apt install gcc-4.8 g++-4.8

步骤 5:现在cd到此目录ns2并解压下载的文件

 tar zxvf ns-allinone-2.35.tar.gz

步骤 6:运行安装脚本

 sudo ./install

步骤 7:打开bashrc文件以使用以下方式设置环境变量

nano ~/.bashrc

在文件中添加以下行。请务必更改user_name为您的用户名

export PATH=$PATH:/home/user_name/ns2/ns-allinone-2.35/bin:/home/user_name/ns2/ns-allinone-2.35/tcl8.5.10/unix:/home/user_name/ns2/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user_name/ns2/ns-allinone-2.35/otcl-1.14:/home/user_name/ns2/ns-allinone-2.35/lib

步骤 8:运行命令

source ~/.bashrc

步骤 9:验证安装。转到目录

/home/user_name/Documents/ns-allinone-2.35/ns-2.35/

并运行:

./validate

等待一会儿之后,如果收到“%”符号,则表示 ns2 正在运行。

相关内容