openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
403 stars 110 forks source link

Zyper failed to install software #483

Closed wenshi01 closed 1 year ago

wenshi01 commented 1 year ago

OS version: SUSE Linux Enterprise Server 15 SP4 zypper version: zypper 1.14.52 network environment : Company network, unable to connect to the Internet

1. Use iso as software source zypper addrepo iso:/?iso=/home/images/SLE-15-SP4-Full-x86_64-GM-Media1.iso iso1 zypper ar -f /mnt/ suse Both commands have been executed

master:~ # zypper addrepo iso:/?iso=/home/images/SLE-15-SP4-Full-x86_64-GM-Media1.iso iso1
Adding repository 'iso1' ........................................................................................................[done]
Repository 'iso1' successfully added

URI         : iso:/?iso=/home/images/SLE-15-SP4-Full-x86_64-GM-Media1.iso
Enabled     : Yes
GPG Check   : Yes
Autorefresh : No
Priority    : 99 (default priority)

Repository priorities are without effect. All enabled repositories share the same priority.
master:~ # zypper addrepo iso:/?iso=/home/images/SLE-15-SP4-Full-x86_64-GM-Media2.iso iso2
Adding repository 'iso2' ........................................................................................................[done]
Repository 'iso2' successfully added

URI         : iso:/?iso=/home/images/SLE-15-SP4-Full-x86_64-GM-Media2.iso
Enabled     : Yes
GPG Check   : Yes
Autorefresh : No
Priority    : 99 (default priority)

Repository priorities are without effect. All enabled repositories share the same priority.
master:~ # 

2 Refresh zypper

master:~ # zypper lr 
Repository priorities are without effect. All enabled repositories share the same priority.

# | Alias | Name | Enabled | GPG Check | Refresh
--+-------+------+---------+-----------+--------
1 | iso1  | iso1 | Yes     | ( p) Yes  | No
2 | iso2  | iso2 | Yes     | ( p) Yes  | No
master:~ # 
master:~ # 
master:~ # 
master:~ # zypper ref
Retrieving repository 'iso1' metadata ...........................................................................................[done]
Building repository 'iso1' cache ................................................................................................[done]
Retrieving repository 'iso2' metadata ...........................................................................................[done]
Building repository 'iso2' cache ---------------------------------------------------------------------------------------------------[-]

Building repository 'iso2' cache ................................................................................................[done]
All repositories have been refreshed.
master:~ # 

3 search wget or tcpdump

master:~ # zypper search wget
Loading repository data...
Reading installed packages...

S | Name | Summary                                   | Type
--+------+-------------------------------------------+-----------
  | wget | A Tool for Mirroring FTP and HTTP Servers | srcpackage

    Note: For an extended search including not yet activated remote resources please use 'zypper
    search-packages'.
master:~ # zypper search tcpdump
Loading repository data...
Reading installed packages...

S | Name    | Summary          | Type
--+---------+------------------+-----------
  | tcpdump | A Packet Sniffer | srcpackage

    Note: For an extended search including not yet activated remote resources please use 'zypper
    search-packages'.
master:~ # 

4 、Error reported during installation

master:~ # zypper install wget 
Loading repository data...
Reading installed packages...
'wget' not found in package names. Trying capabilities.
No provider of 'wget' found.
Resolving package dependencies...
Nothing to do.
master:~ # 
mlandres commented 1 year ago

As you can see in (3.,) the search finds srcpackages only. It looks like the binary (.rpm) packages are not provided by your repos. If those are typical SLES isos, it's due to the way they are built.

If you look onto the iso, you'll see that it in fact contains multiple Module- and Product- repositories located in subdirectories. These repos contain the actual packages you are looking for. You need to pick the repos you need.

So you don't want to add the iso's root directory iso:/ as repo, but e.g. the iso:/Module-Basesystem: zypper addrepo iso:/Module-Basesystem?iso=/home/images/SLE-15-SP4-Full-x86_64-GM-Media1.iso Module-Basesystem