--no-refresh ignored by zypper

On my newest 15.3 installation, DNS is broken for undetermined reason(s). /etc/resolv.conf is the same file I have on most of my installations, where it works as expected.

Consequently, when I want zypper to list some installed package, I must not have zypper wanting to refresh. Thus my syntax is

# zypper --no-refresh se -si somestring

This fails because zypper is obviously insisting on refreshing all autorefresh repos. B.O.O. search summary for dns fail in past 5 months files produces no results. Am I alone, needing to file a bug?

Just a thought around this…have you checked the hosts entry in /etc/nsswitch.conf?

I have no idea what that file is about. rpm -qf says it comes from glibc. It’s timestamped 2021-02-06 20:37, never touched by me.

# grep hosts /etc/nsswitch.conf
...
hosts:          files dns

What does it mean, or do?

That checks out ok. It sets the order for name resolution methods. The ‘files’ entry means that /etc/hosts is checked first, then configured DNS is consulted as part of the name resolution process.

More info:

man nsswitch.conf
man nsswitch.conf

???

I don’t know if it might be related, but recently a few TW users had similar problems with DNS, see:
https://forums.opensuse.org/showthread.php/550273-DNS-issues-on-Tumbleweed-after-update
https://forums.opensuse.org/showthread.php/550276-Internet-trouble-DNS

On this Leap 15.2 system it’s –

hosts:  files mdns_minimal [NOTFOUND=return] dns

Where –

The entry ‘[NOTFOUND=return]’ means that the search for an entry should stop if the search in the previous entry turned up nothing. Note that if the search failed due to some other reason (like no NIS server responding) then the search continues with the next entry.

And one other thing –


 > l /etc/resolv.conf
lrwxrwxrwx 1 root root 26 18. Aug 2020  /etc/resolv.conf -> /run/netconfig/resolv.conf
 > 

Yes, yes, I know – “netconfig” – Yuck!! Blaahh!! – never use ‘/etc/sysconfig/network/config’ …

  • End of the discussion …

@mrmazda:

Haven’t looked myself but, does Leap 15.3 by default enable the “lightweight DHCP and caching DNS server”?

  • Check as follows:

 > systemctl list-unit-files | grep -i 'dns'
avahi-dnsconfd.service                                           disabled       
chrony-dnssrv@.service                                           static         
dnsmasq.service                                                  disabled       
chrony-dnssrv@.timer                                             disabled       
 > 

Also, in ‘/etc/sysconfig/network/config’ I have the following item:

NETCONFIG_MODULES_ORDER="dns-resolver dns-bind nis ntp-runtime -dns-dnsmasq"

Where did “dns-dnsmasq” come from? –


 > ls /etc/netconfig.d/
dns-bind  dns-dnsmasq  dns-resolver  nis  ntp-runtime
 > 

I did a fresh minimal 15.3 installation from DVD. Name resolution started out broken, and is still broken.

Bug reported https://bugzilla.opensuse.org/show_bug.cgi?id=1182722
[zypper] the flag --no-refresh is not known; the flag -F is not known

I have:

  • chrony-dnssrv@.service static -
  • chrony-dnssrv@.timer disabled disabled

Also, in ‘/etc/sysconfig/network/config’ I have the following item:

NETCONFIG_MODULES_ORDER="dns-resolver dns-bind nis ntp-runtime -dns-dnsmasq"

Same here.

Where did “dns-dnsmasq” come from? –

 > ls /etc/netconfig.d/
dns-bind  dns-dnsmasq  dns-resolver  nis  ntp-runtime
 >

I have:

# ls -Gg
-rwxr-xr-x 1  7533 Oct  5 02:38 dns-bind
-rwxr-xr-x 1  7418 Oct  5 02:38 dns-dnsmasq
-rwxr-xr-x 1 10104 Oct  5 02:38 dns-resolver
-rwxr-xr-x 1 12384 Oct  5 02:38 nis
-rwxr-xr-x 1  7280 Oct  5 02:38 ntp-runtime

Here’s a difference I don’t know how to account for. On static IP 15.2:

# systemctl list-unit-files | grep net | sort
network-online.target                   static
network-pre.target                      static
network.service                         enabled
network.target                          static
systemd-networkd-wait-online.service    disabled
systemd-networkd.service                disabled
systemd-networkd.socket                 disabled
xinetd.service                          enabled

On the 15.3 static IP broken DNS installation:

# systemctl list-unit-files | grep net | sort
network-online.target                   static          -
network-pre.target                      static          -
network.service                         alias           -
network.target                          static          -
xinetd.service                          enabled         disabled

Why would network.service be an alias? For what?

Is the latest 15.3 DVD iso broken WRT DNS?

It wasn’t DNS, it was routing. Nothing had configured /etc/sysconfig/network/ifroute-eth0. I used YaST2 to find this out and fix. :slight_smile: Why it didn’t happen is a mystery. :stuck_out_tongue:

You mentioned in a previous post that you’re using static IP, so this would imply that you had configured the network via YaST > Network Settings in the first place? As such, an IP address for the network interface, a gateway address, and at least one DNS entry for name resolution.

Some answers…
https://doc.opensuse.org/documentation/leap/reference/html/book-opensuse-reference/cha-network.html

https://www.freedesktop.org/software/systemd/man/systemd.unit.html

Units can be aliased (have an alternative name), by creating a symlink from the new name to the existing name in one of the unit search paths. For example, systemd-networkd.service has the alias dbus-org.freedesktop.network1.service, created during installation as a symlink, so when systemd is asked through D-Bus to load dbus-org.freedesktop.network1.service, it’ll load systemd-networkd.service. As another example, default.target — the default system target started at boot — is commonly symlinked (aliased) to either multi-user.target or graphical.target to select what is started by default. Alias names may be used in commands like disable, start, stop, status, and similar, and in all unit dependency directives, including Wants=, Requires=, Before=, After=. Aliases cannot be used with the preset command.

I don’t normally “set up” networking as most do. Instead I feed the installer according to linuxrc:

ifcfg=<interface_spec>=[try,]IP_LIST,GATEWAY_LIST,NAMESERVER_LIST,DOMAINSEARCH_LIST,OPTION1=value1,...

I looked in my y2logs and found I made no cmdline typos in my static setup, at least, I don’t think so.

|-- declare -x ifcfg="192.168.0.188,192.168.0.1,1.1.1.1 1.0.0.1,my.domain "

It’s the same format I’ve been using for years, which at Grub I typed in by copying from a custom.cfg with NET installation entries that worked. So it looks like maybe the installer is broken WRT to handling ifcfg= on installer cmdline, since it happened on both recent installs. Or, maybe now I must specify the device in that line?

I guess I need to do another install specifying eth0 device to see if it’s optional or not. I need to anyway since the second wasn’t any better than the first WRT booting NVME without BIOS support. I tried mounting the SATA ESP on /boot/ instead of /boot/efi/, and the installer didn’t bother to create the required efi directory it needed. I sure wish we’d get a new drop, or at least, fix bug 1180626 "We need repos for Leap 15.3 Alpha ".

Sorry to go back to the original problem.

We have only your conclusions about this. You never posted a full zypper command with it’s output where you have --no-refresh as global option in the command line and where the output says that refreshing is taking place nevertheless.
Worse, you did not have any evidence in your bug report.

And as you try to use --no-refrsh as a global option for zypper, I like to point you to the fact that there is no -F as alternative global option for this mentioned in the zypper man page.
(There is however -F, --no-refresh as command options for e.g. the zypper addrepo, modifyrepo and more commands, maybe you are confused by that, but I am afraid that is a bad start to have as a complaint in a bug report).

# egrep 'no-refr|\-F|zypper' .bash_history | egrep -v 'zypseo|zypsei|er al|er rl|v dup|v up|er ll|nel-def|er ref|er lr|er rm' | tail -n...
zypper -v -d dup
zypper -v in iproute2
zypper -v in net-tools
zypper -v in telnet telnet-server
zypper -v in xinetd
zypper -v in yast2-services-manager yast2-bootloader yast2-qt-branding-openSUSE yast2-theme zypper-lifecycle-plugin
zypper -v in iproute2
zypper -v in net-tools
zypper -v in telnet telnet-server
zypper -v in xinetd
zypper -v in yast2-services-manager yast2-bootloader yast2-qt-branding-openSUSE yast2-theme zypper-lifecycle-plugin
zypper -v in ping
zypper -v in --no-refresh ping
zypper -v in --norefresh ping
zypper -v in -norefresh ping
zypper -v in -F ping
zypper -v in ping -F
zypper -v in dnsmasq
zypper -v in ping
zypper -v in iputils
zypper -v in ping
zypper -v in --no-refresh ping
zypper -v in --norefresh ping
zypper -v in -norefresh ping
zypper -v in -F ping
zypper -v in ping -F
zypper -v in dnsmasq
zypper -v in ping
zypper -v in iputils

And as you try to use --no-refrsh as a global option for zypper, I like to point you to the fact that there is no -F as alternative global option for this mentioned in the zypper man page.
(There is however -F, --no-refresh as command options for e.g. the zypper addrepo, modifyrepo and more commands, maybe you are confused by that, but I am afraid that is a bad start to have as a complaint in a bug report).

# cat /usr/local/bin/zypse
#!/bin/sh
zypper --no-refresh se -s $*  | egrep -v 'debug|devel|srcp|openSUSE-20' | egrep 'x86|noarch'| sort

It wouldn’t be in my 7 year old script if it hadn’t worked as I expected, and still does in TW and 15.2.

I did another 15.3 installation just now. What it looks like is everything from the installer cmdline from ifcfg= was ignored in the configured system. The only thing inherited from cmdline was hostname=. It used to be that everything from ifcfg= was incorporated in the configured system, so there was nothing in networking to configure after the installer started its GUI.

You posted…

ifcfg="192.168.0.188,192.168.0.1,1.1.1.1 1.0.0.1,my.domain"

Did you try incorporating the interface explicitly?

None of my 50 or so Grub NET installation stanzas for opensuse have it, so I probably never tried it that way.

I’m at a loss to guess how anyone not using net.ifnames=0 or equivalent would guess what to include for interface name.

I found another clumsy way to botch installation #3, so I have to install again anyway and can try adding it then.

Oh, and my bug got invalidated. I was forgetting every time to put the --no-refresh before the action, really dumb, because my zypse, zypsei and zypseo scripts all have it in the right place. :stuck_out_tongue:

I have no idea how this may answer my remarks. But I see that your bug is rejected for the same reasons I already gave.

When you think that the developers (and I) have any understanding of your personal scripts, I can tell you that that is not the case.

But as the discussion of this thread is still devoted to other things then your --no-refresh case, I will quit from this thread.