Program "g++" not found in PATH on Ubuntu

时间:2015-10-06 09:01:20

标签: c++ c linux eclipse g++

I have eclipse Luna installed on Ubuntu with no internet connection.
I tried to run the simple "Hello World" program but I encountered the error:

Program "g++" not found in PATH

I downloaded (on another computer and copied it) the g++_4.8.2-1ubuntu6_i386.deb and tried to install it:

sudo dpkg -i g++_4.8.2-1ubuntu6_i386.deb

and I got this error message:

dpkg: dependency problems prevent configuration of g++:i386:
g++:i386 depends on cpp (>= 4:4.8.2-1ubuntu6)
g++:i386 depends on gcc (>= 4:4.8.2-1ubuntu6)
g++:i386 depends on g++-4.8 (>= 4.8.2-5~)
g++:i386 depends on gcc-4.8 (>= 4.8.2-5~)

dpkg: error processing g++:i386 (--install)

How can I install that g++ properly with no internet connection?
I will be happy for some guidance.

2 个答案:

答案 0 :(得分:1)

您必须将计算机连接到互联网并更新操作系统。

sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade

然后尝试安装g ++

答案 1 :(得分:0)

您可以使用apt-offline。您需要使用以下命令下载并安装deb文件:

dpkg -i apt-offline_1.3.1_all.deb

此程序将下载在线计算机上的依赖项,您可以将其复制到离线计算机上进行安装。 Here's关于如何使用它的链接。