ubuntu 9.10 安装 G++ bison flex

1.打开终端,输入:sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份当前的源列表,以便日後需要时恢复)

sudo gedit /etc/apt/sources.list (修改sources.list文件中源的列表)
然后把里面的网址改为:

deb http://mirrors.sohu.com/ubuntu/ karmic main restricted
deb-src http://mirrors.sohu.com/ubuntu/ karmic main restricted
deb http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted
deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted
deb http://mirrors.sohu.com/ubuntu/ karmic universe
deb-src http://mirrors.sohu.com/ubuntu/ karmic universe
deb http://mirrors.sohu.com/ubuntu/ karmic-updates universe
deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates universe
deb http://mirrors.sohu.com/ubuntu/ karmic multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-updates multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates multiverse

这些为搜狐的源。

2.输入:sudo apt-get update,经过漫长的等待,更新完毕。

3.输入:sudo apt-get install g++

4.输入:sudo apt-get install flex bison

再尝试行:flex -h

以及:bison -h
如果有信息出现,则安装成功。

Leave a Reply

(will not be published)