[转]Linux(debian, ubuntu)的软件包build-essential的意思 - nkzc

时间:2024-03-02 21:57:55

http://www.cnblogs.com/eleganthqy/archive/2010/01/21/1653679.html

 

在默认情况下ubuntu没有提供c/c++ compile环境, 所以要自己手动安装(但是我可以使用 cc和 gcc compile c程序?)

 

 ubuntu提供了build-essential包让一次把相关软件安装好,很是方便. debian也是可以的, 而centos则可以用 yum install

 

查看哪些包被 build-essential依赖用命令:

apt-cache depends build-essential

输出如下:

eric@eric-laptop:~/source$ apt-cache depends build-essential
build-essential
 |依赖: libc6-dev
  依赖: <libc-dev>
    libc6-dev
  依赖: g++
  依赖: make
  依赖: dpkg-dev

可知道, c库,g++编译器等会被安装.

 

安装方法

sudo apt-get install build-essential

 

PS:今天在ubuntu10.10中安装build-essential 遇到如下错误:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 g++ : Depends: g++-4.4 (>= 4.4.3-1) but it is not going to be installed
E: Broken packages

上网查找,原来是我把ubuntu10.10的源换成了10.04,而10.04中的软件包不够新的缘故吧,换成10.10的源即可。

网上找到的比较快的源:

LUPA开源社区的源:
deb http://mirror.lupaworld.com/ubuntu/ maverick main restricted deb-src http://mirror.lupaworld.com/ubuntu/ maverick main restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates main restricted deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates main restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick universe deb-src http://mirror.lupaworld.com/ubuntu/ maverick universe deb http://mirror.lupaworld.com/ubuntu/ maverick-updates universe deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates universe
deb http://mirror.lupaworld.com/ubuntu/ maverick multiverse deb-src http://mirror.lupaworld.com/ubuntu/ maverick multiverse deb http://mirror.lupaworld.com/ubuntu/ maverick-updates multiverse deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates multiverse
deb http://extras.ubuntu.com/ubuntu maverick main deb-src http://extras.ubuntu.com/ubuntu maverick main deb http://mirror.lupaworld.com/ubuntu/ maverick-security main restricted deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security main restricted deb http://mirror.lupaworld.com/ubuntu/ maverick-security universe deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security universe deb http://mirror.lupaworld.com/ubuntu/ maverick-security multiverse deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security multiverse