Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

  1. #1
    Join Date
    Aug 2005
    Beans
    Hidden!

    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.
    Last edited by blastus; January 29th, 2006 at 07:11 PM.

  2. #2
    Join Date
    Sep 2005
    Location
    Trinidad, Caribbean
    Beans
    591
    Distro
    Ubuntu 6.06

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    Excellent howto. I saw a lot of people having trouble setting up their wireless cards and I guess like you their modem, because they didnt have gcc-3.4 that the kernel uses....

    Again, great work!

  3. #3
    Join Date
    Oct 2005
    Beans
    2

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    I've done exactly what's in this howto, but when I type sudo apt-get update, I get an error that it ignores the file ./packages and that it can't be found.

    I'd post the exact error message here, but it's in dutch, and I doubt you'd be able read it. If I'm not clear enough, I'll see if I can change it to english.

  4. #4
    Join Date
    Jan 2005
    Beans
    222

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    I should like to point out that there is no need to create a local repository; you can just install the three debian packages with dpgk from the command line.

    sudo dpkg -i filename
    ...

  5. #5
    Join Date
    Oct 2005
    Beans
    2

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    Quote Originally Posted by Arktis
    I should like to point out that there is no need to create a local repository; you can just install the three debian packages with dpgk from the command line.

    sudo dpkg -i filename
    That does work, thanks!

  6. #6
    Join Date
    Aug 2005
    Beans
    Hidden!

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    Quote Originally Posted by Arrrhalomynn
    I've done exactly what's in this howto, but when I type sudo apt-get update, I get an error that it ignores the file ./packages and that it can't be found.

    I'd post the exact error message here, but it's in dutch, and I doubt you'd be able read it. If I'm not clear enough, I'll see if I can change it to english.
    If forgot to mention that to use dpkg-scanpackages you need to install the build-essential package. I just finished installing Breezy from scratch and can confirm that it works on my machine. Make sure that the line you added to /etc/apt/sources.list is exactly correct.

    As mentioned, you don't need to setup a local repository. You can use dpkg -i instead, but I trashed my system doing it that way. As far as I know, dpkg -i does not automatically handle dependencies so it will not install the binutils package (which is on the Breezy CD) and seems to be required for gcc-3.4. I used the apt-get method because it seems more reliable.

  7. #7
    Join Date
    Jan 2005
    Beans
    222

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    Well, you could always use 'apt-get check' to look for broken dependancies, and then you can satisfy them from the cd.
    ...

  8. #8
    Join Date
    Oct 2005
    Beans
    44

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    Hi blastus,

    I've followed all the steps u listed conscientiously... And it works great!!! Tks a million. Let's keep the community effort ongoing!

  9. #9
    Join Date
    Aug 2005
    Beans
    Hidden!

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    Quote Originally Posted by elfgoh
    Hi blastus,

    I've followed all the steps u listed conscientiously... And it works great!!! Tks a million. Let's keep the community effort ongoing!
    Thanks elfgoh! I hope you are able to get your modules compiled now.

  10. #10
    Join Date
    Aug 2005
    Beans
    15

    Re: HOWTO: Install gcc-3.4 via apt-get without an Internet connection

    I'm having trouble with this very issue.
    Seems to me that it would make more sense to recompile the kernel in the latest gcc. Does anyone know if there is an ubuntu specific tutorial out there on how to do that?

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •