本文档翻译自:https://docs.conan.io/en/latest/reference/commands/misc/remote.html

    1. $ conan remote [-h]
    2. {list,add,remove,update,rename,list_ref,add_ref,remove_ref,update_ref,list_pref,add_pref,remove_pref,update_pref,clean,enable,disable}
    3. ...

    管理远程列表和与远程关联的软件包配方。

    1. positional arguments:
    2. {list,add,remove,update,rename,list_ref,add_ref,remove_ref,update_ref,list_pref,add_pref,remove_pref,update_pref,clean,enable,disable}
    3. sub-command help
    4. list List current remotes
    5. add Add a remote
    6. remove Remove a remote
    7. update Update the remote url
    8. rename Update the remote name
    9. list_ref List the package recipes and its associated remotes
    10. add_ref Associate a recipe's reference to a remote
    11. remove_ref Dissociate a recipe's reference and its remote
    12. update_ref Update the remote associated with a package recipe
    13. list_pref List the package binaries and its associated remotes
    14. add_pref Associate a package reference to a remote
    15. remove_pref Dissociate a package's reference and its remote
    16. update_pref Update the remote associated with a binary package
    17. clean Clean the list of remotes and all recipe-remote
    18. associations
    19. enable Enable a remote
    20. disable Disable a remote
    21. optional arguments:
    22. -h, --help show this help message and exit

    Examples

    • 远程服务器列表

      1. $ conan remote list
      2. conan-center: https://conan.bintray.com [Verify SSL: True]
      3. local: http://localhost:9300 [Verify SSL: True, Disabled: True]
    • 以几乎对remotes.txt有效的格式列出遥控器,以便与conan config install一起使用,只需要删除附加到禁用的遥控器的True布尔值(输出中的本地提示栏):

      1. $ conan remote list --raw
      2. conan-center https://conan.bintray.com True
      3. local http://localhost:9300 True True
      4. # capture the current remotes in a text file
      5. $ conan remote list --raw > remotes.txt
    • 添加一个新的远程服务器:

      1. $ conan remote add remote_name remote_url [verify_ssl]

      验证SSL选项可以为True或False(默认为True)。 柯南客户端将验证SSL证书。

    • 插入一个新的远程服务器:

    作为第一个插入(位置/索引0),因此它是首个被检索的:

    1. $ conan remote add remote_name remote_url [verify_ssl] --insert

    作为第二个插入(位置/索引1),因此它是要检查的第二个:

    1. $ conan remote add remote_name remote_url [verify_ssl] --insert=1
    • 添加或插入一个远程服务器

    将—force参数添加到柯南远程添加中将始终有效,并且不会引发错误。 如果存在具有该远程名称或URL的现有远程,它将使用新信息进行更新。 —insert的工作原理相同。 如果未指定,则遥控器将附加到最后一个遥控器。 如果指定,该命令会将遥控器插入指定位置

    1. $ conan remote add remote_name remote_url [verify_ssl] --force --insert=1
    • 移除一个远程服务器

      1. $ conan remote remove remote_name
    • 删除所有已配置的遥控器(这还将删除所有配方-远程关联):

      1. $ conan remote clean
    • 更新远程服务器:

      1. $ conan remote update remote_name new_url [verify_ssl]
    • 重命名远程服务器

      1. $ conan remote rename remote_name new_remote_name
    • 将现有的遥控器更改为第一个位置:

      1. $ conan remote update remote_name same_url --insert 0

      列出软件包配方及其关联的远程服务器:

      1. $ conan remote list_ref
      2. bzip2/1.0.6@lasote/stable: conan.io
      3. Boost/1.60.0@lasote/stable: conan.io
      4. zlib/1.2.8@lasote/stable: conan.io

      将配方的参考关联到指定远程服务器:

      1. $ conan remote add_ref openssl/1.0.2u conan-center

      更新与软件包配方关联的遥控器:

      1. $ conan remote update_ref openssl/1.0.2t local-remote

      启用或禁用远程服务器(使用Unix Shell样式通配符接受诸如*之类的模式作为参数):

      1. $ conan remote disable "*"
      2. $ conan remote enable local-remote

    :::info Note
    选中“如何管理SSL(TLS)证书”部分,以了解有关服务器证书验证和客户端证书管理的更多信息。 :::