5

I use zypper si command to install source package in SUSE:

localhost:/dev/disk/by-id # zypper si zlib
Reading installed packages...
Loading repository data...
Resolving package dependencies...

The following source package is going to be installed:
  zlib

1 source package to install.
Overall download size: 587.0 KiB. Already cached: 0 B. After the operation, additional 597.7 KiB will be used.
Continue? [y/n/? shows all options] (y): y
Checking for file conflicts: ........................................................................................................[done]

But when I use the command: zypper se to check package state, it shows "not installed":

localhost:/dev/disk/by-id # zypper se zlib
Loading repository data...
Reading installed packages...

S | Name | Summary                  | Type
--+------+--------------------------+-----------
  | zlib | Data Compression Library | srcpackage

Could anyone give some clues?

2 Answers 2

4

Actually, the source package has been installed successfully in /usr/src/package folder. But it is not marked as "installed" state from this document:

HINT: Source packages can be copied from the installation medium to the hard disk and unpacked with YaST. They are not, however, marked as installed ([i]) in the package manager. This is because the source packages are not entered in the RPM database. Only installed operating system software is listed in the RPM database. When you install a source package, only the source code is added to the system.

2
  • 2
    Well then, how to install the binaries you get from the source? Commented Aug 17, 2019 at 7:07
  • That, my friend, is a whole other can o' worms... Commented Aug 2, 2021 at 3:42
1

The package is not yet installed, you need the rpmbuild command to create it first. Zypper only downloaded the sources needed for compilation.

cd into /usr/src/packages and do as root or sudo rpmbuild -ba SPECS/yourfilename.spec and it will be compiled into the directory with your processor architecture name. For me would that be /usr/src/packages/RPMS/x86_64/.

Install it with

rpm -ivh /path/to/yourfilename.rpm

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.