一。 方法1:
http://forum.ubuntu.org.cn/viewtopic.php?t=295355
不同的ubuntu版本包含的软件包版本也不同,如果需要老版本的软件,自然的想法就是
去老版本的ubuntu中找,所以软件源中需要添加老ubuntu版本对应的软件源。查看
/etc/apt/source.list文件,发现其中记录了使用的软件源,需要在该文件中补充。软件
源的格式如下:
deb http://cn.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
本来还有一些deb-src开头的记录,后面内容和上面5项分别对应,想来应该是下载源码的,就删掉了。
细看这些记录,发现每行都有hardy,这就是ubuntu发行版的代号,对应是8.04,够老的吧,呵呵
如果需要其它ubuntu版本的源,可以修改每行的发行版代号,把hardy修改为对应的代号,如10.04对应
的代号是lucid。
pay attation: save the original source.list file, and delete all the original list and copy the above list.
# sudo apt-get update
# sudo apt-get install gcc-3.4
二。 方法二:
http://ubuntuforums.org/showthread.php?t=79896
1. Find a machine that has an Internet connection and download the following 3 packages
cpp-3.4_3.4.4-6ubuntu8_i386.deb (1707096 bytes)
gcc-3.4_3.4.4-6ubuntu8_i386.deb (484408 bytes)
gcc-3.4-base_3.4.4-6ubuntu8_i386.deb (163028 bytes)
2. On your Breezy machine, create a directory called "gcc-3.4" and copy the above files to it
mkdir ~/gcc-3.4
cd ~/gcc-3.4 sudo apt-get install build-essential dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
** Packages in archive but missing from override file: ** cpp-3.4 gcc-3.4 gcc-3.4-base Wrote 3 entries to output Packages file.
sudo gedit /etc/apt/sources.list
Then add the following line to the file:
deb file:///home/username/gcc-3.4 ./
deb file:///home/susie/gcc-3.4 ./
sudo apt-get update sudo apt-get install gcc-3.4
Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: binutils cpp-3.4 gcc-3.4-base Suggested packages: binutils-doc gcc-3.4-doc libc6-dev-amd64 Recommended packages: libc6-dev The following NEW packages will be installed: binutils cpp-3.4 gcc-3.4 gcc-3.4-base 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/3824kB of archives. After unpacking 15.2MB of additional disk space will be used. Do you want to continue [Y/n]? y WARNING: The following packages cannot be authenticated! gcc-3.4-base cpp-3.4 gcc-3.4 Install these packages without verification [y/N]? y Preconfiguring packages ... Selecting previously deselected package binutils. (Reading database ... 56661 files and directories currently installed.) Unpacking binutils (from .../binutils_2.16.1-2ubuntu6_i386.deb) ... Selecting previously deselected package gcc-3.4-base. Unpacking gcc-3.4-base (from .../gcc-3.4-base_3.4.4-6ubuntu8_i386.deb) ... Selecting previously deselected package cpp-3.4. Unpacking cpp-3.4 (from .../cpp-3.4_3.4.4-6ubuntu8_i386.deb) ... Selecting previously deselected package gcc-3.4. Unpacking gcc-3.4 (from .../gcc-3.4_3.4.4-6ubuntu8_i386.deb) ... Setting up binutils (2.16.1-2ubuntu6) ... Setting up gcc-3.4-base (3.4.4-6ubuntu8) ... Setting up cpp-3.4 (3.4.4-6ubuntu8) ... Setting up gcc-3.4 (3.4.4-6ubuntu8) ...
You should now be able to compile your kernel modules. Following these steps, I was able to compile the kernel modules for my Lucent modem. Once you get an Internet connection, go back and uncomment all the lines you commented out in /etc/apt/sources.list in step 4. You can also remove the line you added to /etc/apt/sources.list and the ~/gcc-3.4 directory if you like.