Install go-swagger on Linux Ubuntu

huangapple go评论74阅读模式
英文:

Install go-swagger on Linux Ubuntu

问题

我可以帮你解决这个问题。根据你提供的信息,你在Linux Ubuntu 22.04上安装go-swagger时遇到了问题。你的代码中使用了apt命令来安装swagger,但是在你的笔记本上出现了"Unable to locate package swagger"的错误。

这个错误通常是由于无法找到指定的软件包导致的。可能是因为你添加的go-swagger源不正确或者没有正确更新软件包列表。

你可以尝试以下步骤来解决这个问题:

  1. 确保你的系统已经更新到最新的软件包列表。可以使用以下命令进行更新:

    sudo apt update
    
  2. 检查你添加的go-swagger源是否正确。你可以使用以下命令查看源文件的内容:

    cat /etc/apt/sources.list.d/go-swagger-go-swagger.list
    

    确保源文件中的URL正确,并且没有任何错误。

  3. 如果你发现源文件有错误,你可以尝试重新添加正确的源。首先,删除现有的源文件:

    sudo rm /etc/apt/sources.list.d/go-swagger-go-swagger.list
    

    然后,使用以下命令添加正确的源:

    echo "deb [arch=amd64] https://dl.cloudsmith.io/public/go-swagger/go-swagger/deb/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/go-swagger-go-swagger.list
    
  4. 更新软件包列表并重新安装swagger:

    sudo apt update
    sudo apt install swagger
    

请尝试以上步骤,看看是否能够解决你的问题。如果问题仍然存在,请提供更多详细信息,以便我能够更好地帮助你。

英文:

I want to install go-swagger on LInux Ubuntu 22.04 but i have blocker. This is my code to install go-swagger.

sudo apt install -y apt-transport-https gnupg curl
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/gpg.2F8CB673971B5C9E.key' | sudo apt-key add -
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/config.deb.txt?distro=debian&codename=any-version' | sudo tee /etc/apt/sources.list.d/go-swagger-go-swagger.list
sudo apt update 
sudo apt install swagger

but the result on my laptop

Unable to locate package swagger

please help me to the solving my blocker

答案1

得分: 2

这类似于Caddy上的bug,由于CloudSmith的更改导致的。运行以下命令:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https

curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/gpg.2F8CB673971B5C9E.key' | sudo gpg --dearmor -o /usr/share/keyrings/go-swagger-go-swagger-archive-keyring.gpg

导入密钥。

英文:

This is similar to the bug on Caddy due to changes in CloudSmith. Run

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https

curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/gpg.2F8CB673971B5C9E.key' | sudo gpg --dearmor -o /usr/share/keyrings/go-swagger-go-swagger-archive-keyring.gpg

to import the key.

huangapple
  • 本文由 发表于 2022年9月14日 08:16:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/73710253.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定