How to install pwgen ?

I searched Yast > Software Management > pwgen

but got no results. Then I went to found pwgen but when I tried to install with one click install the installation failed saying pwgen failed to install.

How can I install pwgen ?

Did you select the 15.0 version? the first one found is for TW

I would surmise you being directed to an incomplete mirror…

It’s part of the distribution…

zypper if pwgen

Information for package pwgen:
Repository     : openSUSE-Leap-15.0-Oss  
Name           : pwgen                   
Version        : 2.08-lp150.1.3     

Yes. I used the “opensuse 15 Leap” filter and got the result which clearly says

Ver 2.08
SIze 22.5KB
opensuse Leap 15

but the one click install failed.

Error message??? failed covers a lot of area need to be more specific

Loading repository data...
Warning: Repository 'openSUSE-Leap-15.0-Update' appears to be outdated. Consider using a different mirror or server.
Reading installed packages...

package 'pwgen' not found.

No problem installing using YaST2 Software Management here in the UK using:

Try a different mirror perhaps…

You need to refresh and use a different mirror… it’s in the default 15.0 oss repository, no need to use a one click.

==> Warning: Repository ‘openSUSE-Leap-15.0-Update’ appears to be outdated. Consider using a different mirror or server. <==

So can you see it in the mirror list for your locale?

Since pwgen is supposed to be in the oss repo,
I wonder if there is something amiss on your machine, it’s one thing for the package not found, it’s another thing not to even be able to find the package… and this is aside from your having a problem updating your oss-update repo.

One gotcha you might have is that prior to 15.1, you may have disabled your install source (which would also have been your original oss repo) but never enabled your online oss (you almost absolutely need this if you disable your original install source). With 15.1, this little maneuver is done automatically.

Post your repository list with URLs so your repos can be checked and verified. You should see minimally 4 enabled repos… oss, oss-update, non-oss, non-oss-update

zypper lr -d

Then forcibly try to refresh your repos, if any fail you should see a reason for the failure like a bad network connection, bad location, etc

zypper refresh

If the above succeed, then your problems likely resolved on their own and you should now be able to search for pwgen, the following is from the command line instead of using YaST (no difference which you choose)

zypper se pwgen

And, if your system can find a package, then you should be able to install it

zypper in pwgen