注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

一路

To find the final symmetry & beauty

 
 
 

日志

 
 
 
 

install gcc-3.4 via apt-get without an internet connection[quote]  

2012-03-17 01:43:07|  分类: 共享 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
HOWTO: Install gcc-3.4 via apt-get without an Internet connection

Compiling kernel modules on Breezy is difficult because the kernel was compiled with gcc-3.4.5 but the distribution CD does not contain gcc-3.4. Instead, when you install the build-essential package, gcc-4.0.2 is installed. The issue is that to compile kernel modules, you need the same version of gcc that was used to compile the kernel, otherwise you cannot compile kernel modules. This presents a dilemma to those (like myself) that have to compile kernel modules for modems and things like that in order to connect to the Internet. NOTE: this guide is for i386 architectures only.

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
Code:
mkdir ~/gcc-3.4
3. Create a local repository
Code:
cd ~/gcc-3.4 sudo apt-get install build-essential dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
You should see something like this:
Code:
 ** 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.
4. Edit /etc/apt/sources.list
Code:
sudo gedit /etc/apt/sources.list
Comment out all the lines in the file that start with "deb-src http" or "deb http". To comment out a line, add a pound character # to the start of the line. We want to do this because we do not have an Internet connection, so we cannot access any repositories that exist on the Internet.

Then add the following line to the file:
Code:
deb file:///home/username/gcc-3.4 ./
Replace "username" with your username. For example, if your usename is "susie" then you would add this line instead:
Code:
deb file:///home/susie/gcc-3.4 ./
5. Install gcc-3.4
Code:
sudo apt-get update sudo apt-get install gcc-3.4
You should see something like this:
Code:
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) ...
If step 5 doesn't work for you, you may want to try Arktis' tip "sudo dpkg -i filename" after you download the .deb files, where the filename is the .deb file. Try that for all three .deb files in addition to "sudo apt-get install binutils". I think "sudo dpkg -i *.deb" may do the trick.

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.
  评论这张
 
阅读(1127)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017