OPNsense Forum

English Forums => General Discussion => Topic started by: mihak on February 03, 2021, 06:04:51 pm

Title: Could not find the repository on the selected mirror
Post by: mihak on February 03, 2021, 06:04:51 pm
My OPNSense update doesn't want to connect to repos anymore.
One thing I changed: I temporarily enabled FreeBSD repo in order to install mosh server. Then I disabled FreeBSD repo again.
Yet, as I installed mosh, my pkg was upgraded too:

Checking packages: ..................................................
pkg-1.16.2 repository mismatch: FreeBSD
pkg-1.16.2 version mismatch, expected 1.15.10_2
Checking packages: .................. done


How can I bring pkg and repos back into OPNSense alignment?
Title: Re: Could not find the repository on the selected mirror
Post by: mihak on February 03, 2021, 06:26:12 pm
sudo pkg install -r OPNsense -f pkg

And everything is back to normal. Closing the issue. :-)
Title: Re: Could not find the repository on the selected mirror
Post by: franco on February 05, 2021, 01:58:26 pm
Better stay away from the FreeBSD repo... pkg likes to upgrade what it can.

Unfortunately pkg in FreeBSD has a feature that kills services on reload so their package does not work for us at all.


Cheers,
Franco
Title: Re: Could not find the repository on the selected mirror
Post by: firewall on February 08, 2021, 08:07:57 pm
Better stay away from the FreeBSD repo... pkg likes to upgrade what it can.

Unfortunately pkg in FreeBSD has a feature that kills services on reload so their package does not work for us at all.


i'm getting the same "Could not find the repository on the selected mirror" error but i haven't messed with the repos.  is the "sudo pkg install -r OPNsense -f pkg" fix mentioned above still a recommended fix?
Title: Re: Could not find the repository on the selected mirror
Post by: franco on February 08, 2021, 08:54:13 pm
Well, do you have pkg 1.6.2 installed? oO


Cheers,
Franco
Title: Re: Could not find the repository on the selected mirror
Post by: firewall on February 08, 2021, 10:20:21 pm
Well, do you have pkg 1.6.2 installed? oO


According to System:Firmware:Packages ->

pkg   1.15.10_2
pkgconf   1.7.3,1
Title: Re: Could not find the repository on the selected mirror
Post by: Rickytr on February 09, 2021, 07:46:34 pm
I have exactly the same problem and the same versions:

pkg   1.15.10_2
pkgconf   1.7.3,1

The problem started, as far as I can tell, after the update to 21.1.1.
Title: Re: Could not find the repository on the selected mirror
Post by: franco on February 09, 2021, 07:56:51 pm
People seem to have this error now which is suspicious timing. One user found out there is a stale /usr/local/etc/repos/SunnyValley.conf in their systems pointing to a release before 20.7 on their end. Maybe that mirror directory got deleted because no longer supported but installing multiple repositories is never easy so that's that... Try to delete that config file.

FWIW, the recent updates *do not* cause this. Our repos are fine.


Cheers,
Franco
Title: Re: Could not find the repository on the selected mirror
Post by: Rickytr on February 09, 2021, 08:04:06 pm
You're right Franco. I checked again and I found that that problem was related to the ntopng repository I installed. I removed it and installed again and now everything is working.

Thanks a lot.

Riccardo
Title: Re: Could not find the repository on the selected mirror
Post by: franco on February 09, 2021, 08:52:00 pm
Hi Riccardo,

Aha, not sure what is going on at NTOP repo as well.

For such cases I am working on a connectivity audit for the firmware page to be able to pinpoint these issues better. I have no ETA but it will likely be available with 21.7 if not sooner.


Cheers,
Franco
Title: Re: Could not find the repository on the selected mirror
Post by: sed on February 10, 2021, 08:13:34 am
One user found out there is a stale /usr/local/etc/repos/SunnyValley.conf in their systems...Try to delete that config file.

Removing:
/usr/local/etc/pkg/repos/SunnyValley.conf
Solved this issue for me.

thanks very much!
Title: Re: Could not find the repository on the selected mirror
Post by: firewall on February 11, 2021, 05:34:35 am
Removing:
/usr/local/etc/pkg/repos/SunnyValley.conf
Solved this issue for me.

thanks very much!

this worked for me as well.
Title: Re: Could not find the repository on the selected mirror
Post by: brettrbarker on April 18, 2021, 11:36:40 pm
Ok, I had this same problem with it not finding the repository. I hadn't added or enabled any other repos. My install is fairly stock with a few additional add-ons. Poking around from clues of people saying to remove repos from /usr/local/etc/pkg/repos, I found that i had to copy the FreeBSD.conf.sample to FreeBSD.conf to make it live to disable the FreeBSD repo. This seems to work. My OPNSense has found the 21.1.4 update now and is in progress of updating. I had never done anything to specifically enable this FreeBSD repo that I know of. I had to go in specifically to disable it.

Again, not sure what caused it to break. Seemed to do it after 21.1 update, but I won't blame anyone. Just sharing my experience if it will help anyone else.
Title: Re: Could not find the repository on the selected mirror
Post by: franco on April 19, 2021, 08:42:02 am
FWIW, since 21.1.3 you can quickly check the enabled repositories from the System: Firmware: Status page.


Cheers,
Franco
Title: Re: Could not find the repository on the selected mirror
Post by: LuLe on July 30, 2021, 08:32:08 pm
Hi - could you tell me the exact command how to delete that config file? I have exact the same error message on two of our client Firewalls. Thank you.
Title: Re: Could not find the repository on the selected mirror
Post by: TheRealBeltet on September 16, 2021, 08:41:36 pm
Hi - could you tell me the exact command how to delete that config file? I have exact the same error message on two of our client Firewalls. Thank you.

I ran in to that problem exactly now when I wanted to update from 21.1
What I did was:

edit OPNsense.conf
Code: [Select]
nano /usr/local/etc/pkg/repos/OPNsense.conf
Change one line
Code: [Select]
url: "pkg+https://pkg.opnsense.org/${ABI}/21.1/latest",to
Code: [Select]
url: "pkg+https://pkg.opnsense.org/${ABI}/21.7/latest",
Then I did
Code: [Select]
pkg update
pkg upgrade
reboot

After that I went in to the GUI and updated, there were a few packages that wanted to be reinstalled and few updrades.
Now it seems updated.

credits goes to a older thread here:
https://forum.opnsense.org/index.php?topic=18361.0
Title: Re: Could not find the repository on the selected mirror
Post by: klyle on April 19, 2023, 06:28:25 pm
Hello I was following along with a tutorial on VB setting up OPNsense. overall Im a novice when it comes to this stuff. But I got my OPNsense set up and signed in through my windows VM and when I go to update I get a notice of "Could not find the repository on the selected mirror"

I changed the mirror in system > firmware > settings > mirror but none of them change my result

I ticked the box for "prefer to use IPv4 in system > settings > general

So Im a little at a loos on what I can do from here with my novice knowledge.
Title: Re: Could not find the repository on the selected mirror
Post by: klyle on April 19, 2023, 06:37:00 pm
When I did an audit I got "no route to host " when I looked that up someone mentioned to check the wan and I saw I needed to  "apply changes" when I did that it updated no problems.
Title: Re: Could not find the repository on the selected mirror
Post by: mcsedude on November 30, 2023, 12:34:00 pm
Go to system firmware settings and change the mirror, that worked for me.