installing package sources with zypper (doesn't work).

How come the following command doesn’t work:

$ zypper source-install --no-build-deps patch
Reading installed packages...
Loading repository data...
Resolving package dependencies...

Continue? [y/n/?] (y): y
Installing source package patch-2.6.1.116-4.1.5
Problem installing source package patch-2.6.1.116-4.1.5:
[repo-source|http://download.opensuse.org/source/distribution/12.1/repo/oss/] Can't provide file './suse/src/patch-2.6.1.116-4.1.5.src.rpm' from repository 'repo-source'

However the file exists: http://download.opensuse.org/source/distribution/12.1/repo/oss/suse/src/patch-2.6.1.116-4.1.5.src.rpm, the repo is enable …

$ zypper lr
#  | Alias                              | Name                               | Enabled | Refresh
---+------------------------------------+------------------------------------+---------+--------
 1 | PTA                                | PTA                                | Yes     | No     
 2 | Updates-for-openSUSE-12.1-12.1-1.4 | Updates for openSUSE 12.1 12.1-1.4 | Yes     | Yes    
 3 | nvidia                             | nvidia                             | Yes     | No     
 4 | openSUSE-12.1-12.1-1.4             | openSUSE-12.1-12.1-1.4             | Yes     | No     
 5 | openSUSE:Education                 | openSUSE:Education                 | No      | No     
 6 | openSUSE:Education:Factory         | openSUSE:Education:Factory         | No      | No     
 7 | openSUSE:Factory:Contrib           | openSUSE:Factory:Contrib           | No      | No     
 8 | openSUSE:Factory:Contrib:standard  | openSUSE:Factory:Contrib:standard  | No      | No     
 9 | openSUSE:Games                     | openSUSE:Games                     | No      | No     
10 | openSUSE:Gnome:Community           | openSUSE:Gnome:Community           | No      | No     
11 | openSUSE:Network:utilities         | openSUSE:Network:utilities         | No      | No     
12 | openSUSE:Utilities                 | openSUSE:Utilities                 | No      | No     
13 | packman                            | packman                            | Yes     | No     
14 | repo-debug                         | openSUSE-12.1-Debug                | No      | Yes    
15 | repo-debug-update                  | openSUSE-12.1-Update-Debug         | No      | Yes    
16 | repo-non-oss                       | openSUSE-12.1-Non-Oss              | Yes     | Yes    
17 | repo-oss                           | openSUSE-12.1-Oss                  | Yes     | Yes    
**18 | repo-source                        | openSUSE-12.1-Source               | Yes     | Yes    **
19 | virtualbox                         | virtualbox                         | Yes     | No     

the user’s rpmbuild environment looks ok:

ls ~/rpmbuild
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS

And the devel_rpm_build pattern is installed:

# rpm -qa | grep devel_rpm_build
patterns-openSUSE-devel_rpm_build-12.1-25.21.1.i586

  • I took “patch” as an example. But the problem seems to affect any package (from any repo - such as packman and my own repo).

I guess (but I am not sure, I do not have the Source repo enabled) that this is because the package name is patch and does not include a version. This is how it is in the other repos.

On 11/28/2011 02:06 PM, please try again wrote:
> How come the following command doesn’t work

are there more clues in /var/log/zypper.log

can you use YaST > Software Management to search for and install the
‘patch’ source (just wondering if it is a zypper bug, or a libzip bug?)

or, maybe it is a flaky mirror ??


DD
openSUSE®, the “German Engineered Automobiles” of operating systems!

Seems to be a mirror problem, same command installs the source rpm just
fine on my 12.1 test system.
Did you try a “zypper ref”.


PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.3 |
nVidia ION | 3GB Ram

When that is tthe case, pplease forget my suggestion.

Humm … It looks like I have a problem then. Ok, let me describe the situation.
I have always installed everything with zypper, mostly from scripts or command line. I keep the latest versions of the rpms on a fileserver in order not to have to redownload them every time. On each computer /var/cache/zypp/packages is a symlink to a directory on the fileserver.

On a 11.4 desktop:

readlink /var/cache/zypp/packages
/sdata/Linux/openSUSE/11.4/packages

On a 12.1 desktop:

readlink /var/cache/zypp/packages
/sdata/Linux/openSUSE/12.1/packages

I use zypper refresh and zypper update on all machines (for years) without problem. I don’t install rpm sources with zypper. So I don’t remember if it ever worked. I usually download sources with wget, install locally with rpm -i or build in OBS.

Today I noticed that hddtemp was missing on the 12.1 I’m setting up. It was in packman for 11.4. Howewer for 12.1, only the source is available. So I decided to download and install the source with this very simple script:


#! /bin/bash

dist=$(lsb_release -si)

case $dist in
    MandrivaLinux) /usr/sbin/urpmi --install-src $1 ;; 
    "SUSE LINUX") zypper source-install --no-build-deps $1 ;;
    Fedora) yumdownloader --destdir . --source $1 && rpm -ivh $1 ;;
esac

As it didn’t work, I tried zypper source-install directly. Since zypper source-install failed for hddtemp, I tried a simple one like ‘patch’ from oss source repo, then I tried elvis from my repo, with always the same result (see below).

[noparse]$ zypper source-install --no-build-deps hddtemp
Reading installed packages...
Loading repository data...
Resolving package dependencies...

Continue? [y/n/?] (y): y
Installing source package hddtemp-0.3_beta15-13.6
Problem installing source package hddtemp-0.3_beta15-13.6:
[packman|http://ftp.uni-erlangen.de/pub/mirrors/packman/suse/openSUSE_12.1/] Can't provide file './Extra/src/hddtemp-0.3_beta15-13.6.src.rpm' from repository 'packman'

$ zypper source-install --no-build-deps patch
Reading installed packages...
Loading repository data...
Resolving package dependencies...

Continue? [y/n/?] (y): y
Installing source package patch-2.6.1.116-4.1.5
Problem installing source package patch-2.6.1.116-4.1.5:
[repo-source|http://download.opensuse.org/source/distribution/12.1/repo/oss/] Can't provide file './suse/src/patch-                     2.6.1.116-4.1.5.src.rpm' from repository 'repo-source'

$ zypper source-install --no-build-deps elvis        
Reading installed packages...
Loading repository data...
Resolving package dependencies...

Continue? [y/n/?] (y): y
Installing source package elvis-2.2_0-23.1
Problem installing source package elvis-2.2_0-23.1:
[PTA|http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.1/] Can't provide file './src/elvis-2.2_0-23.1.src.rpm' from repository 'PTA'
[/noparse]

What am I doing wrong? lol! I must be doing something wrong.

Solved. :shame:

# zypper -v source-install --no-build-deps hddtemp
Verbosity: 1
Non-option program arguments: 'hddtemp' 
Initializing Target
Retrieving: repomd.xml [done]    
Retrieving: content [done]           
Retrieving: media [done]    
Retrieving: content [done]            
Retrieving: media [done]    
Retrieving: content [done]    
Retrieving: media [done]    
Reading installed packages...
Loading repository data...
Resolving package dependencies...
Force resolution: No

Continue? [y/n/?] (y): y
committing
committingCommitResult  (total 0, done 0, error 0, skipped 0, updateMessages 0)
Installing source package hddtemp-0.3_beta15-13.6
Retrieving: hddtemp-0.3_beta15-13.6.src.rpm [done]            
Problem installing source package hddtemp-0.3_beta15-13.6:
[packman|http://ftp.uni-erlangen.de/pub/mirrors/packman/suse/openSUSE_12.1/] Can't provide file './Extra/src/hddtemp-0.3_beta15-13.6.src.rpm' from repository 'packman'
History:
 - Can't create /var/cache/zypp/packages/packman/Extra/src
 - Can't provide ./Extra/src/hddtemp-0.3_beta15-13.6.src.rpm