Installing GCC with no network

I’ve just installed tumbleweek on a standalone machine that doesn’t have a network connection.

I need to install gcc - but have run into a circular problem.

To install gcc, I need to install glibc-devel

To install glibc-devel, I need to install linux-kernel-headers but no such rpm exists.

I have installed kernel-source, but that creates /usr/src/linux - it does not create /usr/include/linux

In /usr/src/linux I can try and install the headers using “make headers_install” but that needs gcc - which isn’t yet installed.

SO as all I can do is download rpm and transfer to the machine on usb. WHat do I need to install to break this circular dependence problem …



Hi and welcome to the Forum :slight_smile:
More likely the kernel-default-devel package is what you require, but if using zypper, then should get a list of packages required?

How did you do the install? If from the iso image, check the install media source is enabled and it should have all the required packages present.

# zypper install --dry-run gcc
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 13 NEW packages are going to be installed:
  gcc gcc8 glibc-devel libasan5 libatomic1 libitm1 liblsan0 libmpx2
  libmpxwrappers2 libtsan0 libubsan1 libxcrypt-devel linux-glibc-devel

13 new packages to install.
Overall download size: 25.3 MiB. Already cached: 594.2 KiB. After the operation,
additional 101.0 MiB will be used.

I ran that on a machine where “gcc” is not installed. It’s actually a virtual machine, but that might not be relevant. It is running up-to-date Tumbleweed.

That should give an indication on what you need. But it is possible that you also need some packages that I already have installed. Those won’t show up with the command that I used.

I also looked at the Tumbleweed install DVD iso. The most recent that I have on hand is 20190305. And “gcc” is there (in the repo included on the DVD). If the current release is similar, then maybe you should consider downloading the current iso, and installing from there. You can configure an iso as a repo with Yast Software Repositories.

If your machine is newly installed using the DVD and have never been updated online, you have everything you need on the DVD, run the following command which will likely also install a full C development environment.

zypper in kernel-devel kernel-default-devel make gcc

After the above you should be set to do any kernel module building, you don’t even need to reboot.

If you don’t have a DVD…

IIRC gcc does not actually “require” anything else (it’s a standalone binary without any dependencies) but other libraries may be required for certain functionality.

So, for your situation “it depends.”

You should be able to sneakernet any files from another machine with a network connection to your machine, eg using a USB key.

If you have multiple gcc versions side by side on your machine, I wrote a wiki article how to set up alternatives so that you can switch between them easily, otherwise you will like to have to configure (and re-configure) symlinks manually repeatedly.

As for kernel headers, that is a subset of the kernel source and you should install source in place of headers.
Additionally, when you install kernel headers with a network connection, headers specific to your running kernel are installed… There is no general kernel headers that applies to multiple kernels. Needless to say, unless you have machines running identical kernels, you cannot sneakernet kernel development header packages or files from one machine to another… The only practical solution requires an Internet connection or the DVD if you’re running the kernel from the DVD.

When you have a network connection, you can typically install your kernel headers with the following command (assuming the default kernel, you don’t have another kernel flavor installed)

zypper install kernel-devel kernel-default-devel


zypper tries to contact to access the update data ! I don’t have a network …

So I’ve been using “rpm -i” back from my redhat days 20 years ago …

kernel-default-devel depends on libelf-devel.

libelf-devel depends on glibc-devel

And so same circular problem. Think I may just force all these to install - ignoring dependencies …

OK “rpm -i --force --nodeps” installs.

kernel-default-devel installs include files in /usr/src - I’m used to them being in /usr/include/linux - does suse gcc cope with this? Hmmm no - compilation of standard code fails in ./confugure due to missing /usr/include/linux …

gcc8 installs /usr/bin/gcc-8 should there also be a link to /usr/bin/gcc ?

Disable the repos. You can use yast-repository management

Actually guess simple question is what does “rpm -qf /usr/include/linux” and “rpm -qf /usr/bin/gcc” return?

Bingo - that worked. Disabled online repos, enabled the USB isntall iso, and now can use zypper - and it sets up the right links. So I guess zypper does more than rpm - which is a lesson learnt.