27

I've never had a problem installing git on any Linux distro, but now I'm forced to use a client's server which is SLES 11 SP2. It uses yast or zypper to do package management, which I've never used before. Apparently I should be able to zypper install git-core but that doesn't work because it needs a certain repo added. Of course none of this is on the official git installation page here.

I found what packages belong to the SLE11-SP2-SDK repo here. But no instructions on how to add the repo to yast or zypper.

I'll also accept an answer that simply tells me how to install git on a SLES server. I've already tried from source, but of course it's missing requirements which also belong to the SDK repo.

This is what I get when I do "zypper install git-core":

$ sudo zypper install git-core

Refreshing service 'nu_novell_com'.
Loading repository data...
Reading installed packages...
'git-core' not found in package names. Trying capabilities.
No provider of 'git-core' found.
Resolving package dependencies...

Nothing to do.
halfer
  • 19,824
  • 17
  • 99
  • 186
Brade
  • 1,481
  • 1
  • 13
  • 21
  • Maybe I am missing something, but shouldn't `yast` or `zypper` handle the dependencies for you? – halfer Jun 08 '12 at 18:14
  • You would hope, but no. This is what I get when I do "zypper install git-core" (see edit above) – Brade Jun 08 '12 at 18:38
  • I just installed SuSE 12.3 and Git was installed by default. –  Jul 06 '13 at 19:25

6 Answers6

54

I figured it out, only by piecing together other info mainly from the OpenSUSE project. Basically it's:

$ sudo zypper addrepo http://download.opensuse.org/repositories/devel:/tools:/scm/SLE_11_SP2/devel:tools:scm.repo
$ sudo zypper install git-core
Brade
  • 1,481
  • 1
  • 13
  • 21
  • Pleased you sorted it out `:)` – halfer Jun 09 '12 at 10:45
  • 4
    This helped me out, started in the right direction. I had to add the perl repo also, b/c git depends on perl-Error. # add devel perl repo $ sudo zypper addrepo http://download.opensuse.org/repositories/devel:/languages:/perl/SLE_11/devel:languages:perl.repo – burnsjeremy Sep 16 '13 at 18:08
  • 14
    For the perl one the above link didn't work for me. I used: sudo zypper addrepo http://download.opensuse.org/repositories/devel:/languages:/perl/SLE_11_SP3/devel:languages:perl.repo – rooby Dec 19 '13 at 21:40
  • @Brade it would be nice if you update your answer with link from rooby - yours does not exist – Bostone Aug 01 '16 at 16:22
6

git is part of the SDK for SLES, which can be downloaded here:

http://download.novell.com (ideally for the currently used SP2)

Once you installed itm the zypper or yast commands work. It's not recommended to use openSUSE rpms within a SLES environment.

1

Offline Install git on SLES 12 SP2 using SDK ISO

If you do not have direct access to the remote/online SLES zypper repositories, you can add SDK ISO as a repository. Some packages are available in this ISO.

1) Download SLE-12-SP2-SDK-DVD-x86_64-GM-DVD1.iso from https://download.suse.com/Download?buildid=g3e7P21X6Lw~ (It requires sign-up). You can also find your desired ISO SDK at https://download.suse.com

2) Copy & transfer downloaded the file to the SLES machine. (here we transfer it to /temp/SLE-12-SP2-SDK-DVD-x86_64-GM-DVD1.iso)

3) Add ISO as Zypper repository

zypper ar iso:/?iso=/temp/SLE-12-SP2-SDK-DVD-x86_64-GM-DVD1.iso sdk_dvd

4) install git

zypper install git-core
Saeed Zhiany
  • 2,051
  • 9
  • 30
  • 41
Ziaa
  • 128
  • 4
0

You need to download the SLES 11 SP2 SDK DVD's from download.suse.com. In order to access the downloads, you need to register a user account (it's free).

  1. Once downloaded, mount the first DVD. (make sure it is for the correct architecture)

  2. Load up YaST and go to Software->Add-on products.

  3. Then select 'Add' and continue the installation by selecting the installation source, accepting the license, etc.

  4. Repeat for DVD2, unless DVD1 had everything you needed.

Marmoy
  • 8,009
  • 7
  • 46
  • 74
  • How would I do this on a server? Even if it has an optical drive, I cannot easily access the physical server. – StockB Dec 07 '16 at 19:54
  • Use the add-on option in yast with the iso, no need to deal with physical media – Marmoy Dec 07 '16 at 21:09
0

In zypper need to add the repository of git using zypper addrepo <repo_url> command, before trying to install it. You can get the repo URL of git package here.

rashok
  • 12,790
  • 16
  • 88
  • 100
-2

I meet a silly problem during zypper refresh, later figured out that /tmp directory should be created ahead. After that, everything work out.

13392046a881:/ # zypper -v refresh
Verbosity: 1
Initializing Target
Specified repositories: 
Checking whether to refresh metadata for Software configuration management (SLE_11_SP3)
Retrieving: repomd.xml [done]
Repository 'Software configuration management (SLE_11_SP3)' is up to date.
Building repository 'Software configuration management (SLE_11_SP3)' cache [done]
Error building the cache:
[|] Failed to cache repo (3).
History:
- 'repo2solv.sh' '-o' '/var/cache/zypp/solv/devel_tools_scm/solv' '/var/cache/zypp/raw/devel_tools_scm'
mktemp: failed to create file via template `/tmp/tmp.XXXXXXXXXX': No such file or directory
Jacky
  • 1,645
  • 1
  • 14
  • 16