首页 > 解决方案 > Travis:E:无法找到包 dotnet-sdk-2.0.0

问题描述

今天早上我的 travis 构建因错误而停止:

E: Unable to locate package dotnet-sdk-2.0.0

我的 travis yaml(如下)与正在运行的构建没有改变:

language: csharp
dist: trusty
sudo: required
mono: none
dotnet: 2.0.0
solution: Dibware.Salon.sln
addons:
  sonarcloud:
    organization: "dibley1973-github" # the key of the org you chose at step #3
    token:
      secure: $SONAR_TOKEN
branches:
  only:
    - master
before_script:
  - chmod +x build.sh
  - chmod +x run-tests.sh
script:
  - ./build.sh
  - ./run-tests.sh
  - sonar-scanner

日志的关键条目如下:

C# support for Travis-CI is community maintained.
Please open any issues at https://travis-ci.community/c/languages/37-category and cc @joshua-anderson @akoeplinger @nterry
Installing .NET Core
$ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$ export DOTNET_CLI_TELEMETRY_OPTOUT=1
7.67s0.49sE: Unable to locate package dotnet-sdk-2.0.0
E: Couldn't find any package by glob 'dotnet-sdk-2.0.0'
E: Couldn't find any package by regex 'dotnet-sdk-2.0.0'
The command "sudo apt-get install -qq dotnet-sdk-2.0.0" failed and exited with 100 during .
Your build has been stopped.

travis 构建链接: https ://travis-ci.com/dibley1973/Dibware.Salon

任何关于为什么失败的建议都值得赞赏。

标签: .net-coretravis-ci

解决方案


好的,在这里发现这篇文章建议将 dist 更改为xenial

https://travis-ci.community/t/dotnet-core-2-2/1216

这似乎已经解决了


推荐阅读