# How to change the url of the code of a pack

**URL:** <https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139>\
**Category:** Pack\
**Created:** [January 28, 2023, 5:26pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139 "2023-01-28T17:26:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![friguzzi](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/friguzzi/32/7045_2.png) [@friguzzi](https://swi-prolog.discourse.group/u/friguzzi)\
**Post date:** [January 28, 2023, 5:26pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/1 "2023-01-28T17:26:20Z")

</div>

Hi,  
I’m updating the lbfgs pack  
[https://www.swi-prolog.org/pack/list?p=lbfgs](https://www.swi-prolog.org/pack/list?p=lbfgs)  
and I would like the pack to point to [GitHub - friguzzi/lbfgs: An interface to call libLBFGS from within SWI-Prolog](https://github.com/friguzzi/lbfgs.git)  
However, if you do

```prolog
pack_install('https://github.com/friguzzi/lbfgs.git').

```

I got

```prolog
ERROR: Server reported the following error:
ERROR: No permission to register pack(lbfgs) `'https://github.com/friguzzi/lbfgs.git''

```

How should I proceed?

Thanks  
Fabrizio

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [January 28, 2023, 6:52pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/2 "2023-01-28T18:52:32Z")

</div>

There’s some discussion about pack URLs here (including URL patterns and migrating servers):

> [@Pack\_install upgrade doesn't work](https://swi-prolog.discourse.group/t/pack-install-upgrade-doesnt-work/1394/15):
>
> The pack system was designed to work without a central authority. Using a URL pattern to fetch a new version allows for that. The price is indeed that you cannot migrate to another server. The central database that keep track of packs being downloaded can do so, but after some issues the rules were tightened not to allow registering a new version from a different location as well. I think the current pack system is a bit too simple. It did prove the need for one and I guess it is time for …

IIRC, @jan needs to do something if the server changes.  
Have you tried uninstalling the pack and removing all the files, then doing the `pack_install`?

---

<div class="post-metadata">

**Author:** ![friguzzi](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/friguzzi/32/7045_2.png) [@friguzzi](https://swi-prolog.discourse.group/u/friguzzi)\
**Post date:** [January 29, 2023, 2:44pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/3 "2023-01-29T14:44:06Z")

</div>

> [@peter.ludemann](#):
>
> IIRC, @jan needs to do something if the server changes.  
> Have you tried uninstalling the pack and removing all the files, then doing the `pack_install`?

Yes, I tried and I obtained the message above. The problem is that the pack was created when github used the old style URLs of the form `git://github.com/friguzzi/lbfgs` that are no longer working, so the pack is not accessible anymore, @jan, can you please update the address to `https://github.com/friguzzi/lbfgs.git`?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 29, 2023, 4:39pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/4 "2023-01-29T16:39:01Z")

</div>

> [@friguzzi](#):
>
> @jan, can you please update the address to `https://github.com/friguzzi/lbfgs.git`?

Updated. Seems to be in good shape again. Also registered the latest version.

---

<div class="post-metadata">

**Author:** ![soli](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/soli/32/6640_2.png) [@soli](https://swi-prolog.discourse.group/u/soli)\
**Post date:** [July 16, 2024, 9:45am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/5 "2024-07-16T09:45:50Z")

</div>

Sorry to revive this old topic, but I have a similar issue…

I cannot seem to upgrade (on the pack central server) the version of a pack I recently created:

```prolog
?- pack_install('https://soliman.gitlabpages.inria.fr/doctest/doctest-*.zip', [register(true)]).
% Querying "https://soliman.gitlabpages.inria.fr/doctest/" to find new versions ...
% Latest version: 1.1.3 (14 older)
Installation plan:
  Install doctest at version 1.1.3 from https://soliman.gitlabpages.inria.fr/doctest/doctest-1.1.3.zip
Download packs? Y/n? 
% Downloading doctest ... 5,263 bytes
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
true.

?- pack_list_installed.
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
A doctest@1.1.3(1.0.3) - Doctests using PlDoc and PlUnit
true.

```

As shown above, the 1.1.3 version is found and installs correctly, but… it keeps the 1.0.3 as most recent registered/published version.

Indeed the download URL I added initially didn’t take into account that the search is hardcoded for GitHub releases (and doesn’t work for the similar GitLab releases) and I suppose that is what goes wrong.

By the way, if I use `pack_publish` instead (with the same URL), I get:

```prolog
ERROR: Pack doctest at version 1.1.3 is already registered with a different URL
false.

```

Can I do anything on my side to fix this? Otherwise, can you manually change the URL for me?

Thanks!

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 16, 2024, 11:02am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/6 "2024-07-16T11:02:29Z")

</div>

> [@soli](#):
>
> Can I do anything on my side to fix this? Otherwise, can you manually change the URL for me?

I have updated the pattern. No, you can’t do that yourself for obvious reasons. That would only make sense if we have a well secured login for package maintainers.

---

<div class="post-metadata">

**Author:** ![soli](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/soli/32/6640_2.png) [@soli](https://swi-prolog.discourse.group/u/soli)\
**Post date:** [July 16, 2024, 11:06am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/7 "2024-07-16T11:06:18Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![soli](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/soli/32/6640_2.png) [@soli](https://swi-prolog.discourse.group/u/soli)\
**Post date:** [July 22, 2024, 11:44am UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/8 "2024-07-22T11:44:55Z")

</div>

@jan sorry to bother you again, but for some reason, while SWI does find the latest releases:

```prolog
> swipl pack list
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
i doctest@1.2.0 - Doctests using PlDoc and PlUnit

```

The official pack [web page](https://www.swi-prolog.org/pack/list?p=doctest) went back in time (!) back to 1.0.3… I’m pretty sure it picked the new release when you did the URL change, but 🤷🏻‍♂️

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 22, 2024, 12:52pm UTC](https://swi-prolog.discourse.group/t/how-to-change-the-url-of-the-code-of-a-pack/6139/9 "2024-07-22T12:52:49Z")

</div>

Seems one of the backends did not update and that was picked by the CDN. Should be ok in 1 hour.
