Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 1475
Alex Hales
  • 0
Alex HalesTeacher
Asked: May 30, 20222022-05-30T17:28:11+00:00 2022-05-30T17:28:11+00:00

linux – Install gcc offline Ubuntu

  • 0

[ad_1]

I got an offline Ubuntu 20.04. I wanted to use curl, but it wasn’t installed. Trying to install it, needs binutils; tried to install binutils, needs make, tried to install make, needs…gcc!

I seriously didn’t think it was possible to have an Ubuntu without gcc, but here I am, trying to install gcc offline. I’ve followed this stackoverflow question; it doesn’t gives a lot of indications so I’ve read the gnu doc. Here I am a bit lost: seems the prerequisite to install gcc include…gcc, and other things that require gcc to be installed.
So I left out the prerequisite part and started the configuration part.
Here are my step:

  1. Downloaded latest gcc tar.gz file, uploaded it on my ubuntu (with scp), and extracted (in /home/username, keeping the default directory name gcc-12.1.0)
  2. made a new dir: /home/username/objdir (lack of imagination here, just following the doc)
  3. Launch configure from here. According to the doc, it should fail because there’s no cc. Indeed, it fails saying there is no cc.
  4. Managed to found a cc in my ubuntu, but not in bin; it’s in /lib/gcc/x86_64-linux-gnu/9/cc1. I copy-pasted it in /usr/bin, and renamed it cc instead of cc1. Note that there is nothing else in that /lib/gcc directory, only the cc1 at the end. There is a /lib/cpp executable too, so while I was here I’ve tried a cpp -v; the result (below) is weird and I don’t really understand it (I guess it won’t be weird for someone who do understand ^^ )
    cpp -v output
  5. Relaunch configure. Now it does find cc, but fails at the “check if we are cross compiling” step. It says “error in /home/username/objdir; error: cannot run C compiled programs”.
  6. The doc says if, for some reason, configure fails to guess the configuration, add –host=… to the command and the host and target will default to be the same as the host machine. So I’ve launched configure --host=x86_64-pc-linux-gnu (pretty much same name as the dir I found in the /lib/gcc dir, also the one configure writes before failing, so should be good). Now the “check if we are cross-compiling” step pass, saying yes, but next step fails:
    configure result
  7. It says to check config.log for more details, so here I go. It looks to me like it has a hard time finding cc version (like, tries multiple options to get it, but none works)
    check cc version
    Then it goes to “checking if the C compiler works”, and to my surprise, it says yes
    check if C compiler works
    Does other checks that I don’t really understand but it seems happy with it
    other checks
    And then, there is this cross-compiling check, and I really don’t like the output here:
    Check cross-compiling

As you can see, it says “stdio.h: No such file or directory.”. At this point, I’m sick of it and would like to kill the man who installed this Ubuntu without anything; but whatever, following this question I figured I need to install libc6-dev. Now I’ve been to ubuntu packages, and searched for libc6-dev in my version. There is quite a lot. I have no idea which I should take, no idea if I will be able to install it (dependencies says libgcc), and I’m tired of this.

Is there any (more simple) way to install gcc on an offline ubuntu, or should I continue to walk this (seemingly infinite) path?

[ad_2]

  • 0 0 Answers
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 4777 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 1063 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 1009 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.