How to select another mirror in `dnf`?

,

My mirror had stalled and I can not test new update https://bodhi.fedoraproject.org/updates/FEDORA-2022-8cf9d64c36#comment-2684272

Using --setopt=fastestmirror=1 still selects the same stalled server.

sudo dnf upgrade --enablerepo=updates-testing --refresh \
   --advisory=FEDORA-2022-8cf9d64c36 --setopt=fastestmirror=1

How to specify a different mirror for dnf explicitly?

EDIT: Formatted the command to be visible without scrolling.

1 Like

See:

2 Likes

6 hours passed and still can’t test the update. (

I tried setting baseurl with setopt but it didn’t work. Commenting out metalink at the same time didn’t work for rsync urls, but seems that it worked for http. At least the error message changes for alternate server.

-No security updates needed, but 252 updates available
+No security updates needed, but 202 updates available
sudo dnf upgrade --enablerepo=updates-testing --refresh \
  --advisory=FEDORA-2022-8cf9d64c36 \
  --setopt=updates-testing.baseurl=http://www.nic.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/updates/36/Everything/x86_64/ \
  --setopt=updates-testing.metalink=

Can not figure out which mirror is up to date. Home - MirrorManager doesn’t give this info.

fastestmirror picks the one with the least latency, but that doesn’t necessarily mean most available bandwidth or most recently synced. I definitely recommend keeping the defaults (ie, metalink) over fastestmirror. You can also download the rpms directly from the build output on koji if you really can’t wait for it to hit the repo mirrors.

2 Likes

You tried to update two hours after the update was pushed (around 8h is what I’m mostly seeing and it depends on mirrors). Either find out which mirror syncs with upstream earliest or, if you need to get updates instantly, use koji:

1 Like

The url for updates-testing is http://www.nic.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/updates/testing/36/Everything/x86_64/

Note the “updates/testing” part.
You can browse that repository with your web browser. I can see that it does have an updated enki package.

Nice catch. I didn’t think about that. However, it still doesn’t install anything. Saying “Nothing to do.”

sudo dnf upgrade --enablerepo=updates-testing --refresh \
  --advisory=FEDORA-2022-8cf9d64c36 \
  --setopt=updates-testing.baseurl=http://www.nic.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/updates/testing/36/Everything/x86_64/ \
  --setopt=updates-testing.metalink=

Maybe there is no information that advisory means update with Enki and libs. I don’t know.

You can change the country by adding &country=<country code> to the metalink. You can add the country code you want. You have to do this per repo. I believe that with some scripting trickery this can be made easier.

For example, check my Fedora modular repo conf:

[fedora-modular]
name=Fedora Modular $releasever - $basearch
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Modular/$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-$releasever&arch=$basearch&country=de
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

All of your repository files should be in /etc/yum.repos.d/

1 Like

Try, drop the --advisoray and run

dnf --enablerepo=updates-testing upgrade enki

Unfortunately, dnf fails when I try to do this from command line, because it can not parse another = in metalink. I’ve added PR here cli: Allow `=` in `setopt` values by abitrolly · Pull Request #1841 · rpm-software-management/dnf · GitHub but I have low expectations that it will be merged. My previous dnf PRs are not getting attention.

No match for argument: enki

Do you have “enki” installed already? If not; run

dnf --enablerepo=updates-testing install enki

Finally that works.

sudo dnf install --enablerepo=updates-testing --refresh \
  --setopt=updates-testing.baseurl=http://www.nic.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/updates/testing/36/Everything/x86_64/ \
  --setopt=updates-testing.metalink= enki

I wish the testing experience was easier. If I wasn’t jobless, I would just give up. Thanks everyone.

We all assumed that enki was already installed, otherwise upgrading would not make sense SHould have payed closer attention to https://bodhi.fedoraproject.org/updates/FEDORA-2022-8cf9d64c36#comment-2684272

➜  ~ enki
zsh: enki: command not found...

is a giveaway that enki isn’t installed at all , and therefore there was nothing to update. So all your mirrors were not stale after all.

1 Like

I don’t think so. If a package is not explicitly installed, dnf explicitly says so.

➜  ~ sudo dnf upgrade nethack
Last metadata expiration check: 1:51:09 ago on Thu 18 Aug 2022 07:41:51 PM +03.
Package nethack available, but not installed.
No match for argument: nethack
Error: No packages marked for upgrade.

This would not appear for a package that was not in the currently enabled repo.

Since enki was not in either the fedora or the updates repo but was only in the updates-testing repo that trick would not work without explicitly enabling the updates-testing repo, which is what solved the issue.

Sorry, but it is:

[root@newbox ~]# dnf list --showduplicates --enablerepo=updates-testing enki
Last metadata expiration check: 3:33:43 ago on Thu 18 Aug 2022 17:35:15 CEST.
Available Packages
enki.noarch                            21.11.0-2.fc36                             fedora         
enki.noarch                            22.08.0-1.fc36                             updates-testing
[root@newbox ~]# 

oops :hot_face:

Hi Jeff is the mirrors.fedora updates a safe one to keep on. Just wondering because had to delete some funny programs installing. Can we have the option to disable?

@Topic try it with Yum it always works

Yum is a soft link to dnf

https://fedoraproject.org/wiki/Changes/Retire_YUM_3