travis-ci - Travis 构建失败并显示 "apt-get install failed"

标签 travis-ci

我的 travis 构建失败,时常出现以下错误,有什么想法可以解决这个问题吗?

The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install mysql-server mysql-client" failed and exited with 100 during.

travis.yaml

language: python
python:
- '2.7'
env:
  global:
  - CACHE_PATH=${HOME}/.cache
  - CLOUD_SDK_PATH=${CACHE_PATH}/google-cloud-sdk
  - GAE_SDK_PATH=${CLOUD_SDK_PATH}/platform/google_appengine

services:
  - mysql

addons:
  apt:
    sources:
      - mysql-5.7-trusty
    packages:
      - mysql-server
      - mysql-client

dist: trusty
sudo: required

输出:

0.71s$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install mysql-server mysql-client
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  libdbd-mysql-perl libdbi-perl libterm-readkey-perl
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libmecab2 libmysqlclient-dev libmysqlclient20 mysql-common
  mysql-community-client mysql-community-server
The following packages will be REMOVED:
  mysql-client-5.6 mysql-client-core-5.6 mysql-server-5.6
  mysql-server-core-5.6
The following NEW packages will be installed:
  libmecab2 libmysqlclient20 mysql-client mysql-community-client
  mysql-community-server mysql-server
The following packages will be upgraded:
  libmysqlclient-dev mysql-common
2 upgraded, 6 newly installed, 4 to remove and 293 not upgraded.
Need to get 34.0 MB of archives.
After this operation, 83.4 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  mysql-common libmysqlclient20 libmysqlclient-dev mysql-community-client
  mysql-client mysql-community-server mysql-server
E: There were unauthenticated packages and -y was used without --allow-unauthenticated
apt-get.diagnostics
apt-get install failed
$ cat ${TRAVIS_HOME}/apt-get-update.log
Get:1 http://repo.mysql.com/apt/ubuntu trusty InRelease [33.5 kB]
Get:2 http://dl.hhvm.com/ubuntu trusty InRelease [3,106 B]
Ign:3 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 InRelease
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease
Get:5 http://apt.postgresql.org/pub/repos/apt trusty-pgdg InRelease [61.4 kB]
Get:6 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 Release [2,495 B]
Ign:7 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty InRelease
Get:9 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 Release.gpg [801 B]
Get:10 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates InRelease [65.9 kB]
Get:12 http://dl.hhvm.com/ubuntu trusty/main amd64 Packages [1,807 B]
Get:13 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports InRelease [65.9 kB]
Get:14 http://security.ubuntu.com/ubuntu trusty-security InRelease [65.9 kB]
Get:15 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu trusty InRelease [15.4 kB]
Ign:1 http://repo.mysql.com/apt/ubuntu trusty InRelease
Get:8 http://dl.bintray.com/apache/cassandra 39x InRelease [3,168 B]
Get:16 http://repo.mysql.com/apt/ubuntu trusty/mysql-5.7 amd64 Packages [3,361 B]
Get:17 http://repo.mysql.com/apt/ubuntu trusty/mysql-5.7 i386 Packages [3,379 B]
Get:18 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty Release [58.5 kB]
Get:19 https://download.docker.com/linux/ubuntu trusty InRelease [37.1 kB]
Get:20 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4/multiverse amd64 Packages [13.6 kB]
Get:21 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty Release.gpg [933 B]
Get:22 http://dl.google.com/linux/chrome/deb stable Release [943 B]
Ign:11 http://toolbelt.heroku.com/ubuntu ./ InRelease
Get:23 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]
Get:25 http://apt.postgresql.org/pub/repos/apt trusty-pgdg/main amd64 Packages [200 kB]
Get:24 http://toolbelt.heroku.com/ubuntu ./ Release [1,609 B]
Get:27 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/main Sources [527 kB]
Get:26 http://toolbelt.heroku.com/ubuntu ./ Release.gpg [473 B]
Get:28 http://apt.postgresql.org/pub/repos/apt trusty-pgdg/main i386 Packages [199 kB]
Ign:30 http://ppa.launchpad.net/couchdb/stable/ubuntu trusty InRelease
Get:31 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/restricted Sources [6,449 B]
Get:33 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/universe Sources [288 kB]
Get:34 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/multiverse Sources [7,287 B]
Get:29 http://dl.bintray.com/apache/cassandra 39x/main amd64 Packages [682 B]
Get:35 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/main amd64 Packages [1,421 kB]
Get:32 http://dl.bintray.com/apache/cassandra 39x/main i386 Packages [682 B]
Get:36 http://ppa.launchpad.net/git-core/ppa/ubuntu trusty InRelease [20.8 kB]
Get:37 https://download.docker.com/linux/ubuntu trusty/stable amd64 Packages [5,207 B]
Get:38 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/main i386 Packages [1,328 kB]
Get:39 https://download.docker.com/linux/ubuntu trusty/edge amd64 Packages [6,366 B]
Get:40 https://packagecloud.io/computology/apt-backport/ubuntu trusty InRelease [23.5 kB]
Get:41 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/main Translation-en [682 kB]
Get:42 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/restricted amd64 Packages [21.4 kB]
Get:43 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/restricted i386 Packages [21.1 kB]
Get:44 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/restricted Translation-en [3,704 B]
Get:45 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/universe amd64 Packages [660 kB]
Get:46 https://packagecloud.io/github/git-lfs/ubuntu trusty InRelease [23.2 kB]
Get:47 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/universe i386 Packages [641 kB]
Get:48 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty InRelease [15.4 kB]
Get:49 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,110 B]
Get:50 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/universe Translation-en [342 kB]
Get:51 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/multiverse amd64 Packages [16.0 kB]
Get:52 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/multiverse i386 Packages [16.5 kB]
Get:53 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-updates/multiverse Translation-en [7,680 B]
Get:54 http://security.ubuntu.com/ubuntu trusty-security/main Sources [216 kB]
Get:56 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/main Sources [10.4 kB]
Get:57 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/restricted Sources [40 B]
Get:55 http://toolbelt.heroku.com/ubuntu ./ Packages [636 B]
Get:58 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/universe Sources [41.3 kB]
Get:59 https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu trusty InRelease [23.7 kB]
Get:60 http://ppa.launchpad.net/pollinate/ppa/ubuntu trusty InRelease [15.4 kB]
Get:61 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/multiverse Sources [1,747 B]
Ign:46 https://packagecloud.io/github/git-lfs/ubuntu trusty InRelease
Get:62 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/main amd64 Packages [14.7 kB]
Get:63 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/main i386 Packages [14.7 kB]
Get:64 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/main Translation-en [7,426 B]
Get:65 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/restricted amd64 Packages [40 B]
Get:66 http://security.ubuntu.com/ubuntu trusty-security/restricted Sources [5,050 B]
Get:67 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/restricted i386 Packages [40 B]
Get:68 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/restricted Translation-en [40 B]
Get:69 https://packagecloud.io/computology/apt-backport/ubuntu trusty/main Sources [843 B]
Get:70 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/universe amd64 Packages [52.5 kB]
Get:71 http://security.ubuntu.com/ubuntu trusty-security/universe Sources [125 kB]
Get:72 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/universe i386 Packages [52.4 kB]
Get:73 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/universe Translation-en [40.0 kB]
Get:74 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease [15.5 kB]
Get:75 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/multiverse amd64 Packages [1,392 B]
Get:76 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/multiverse i386 Packages [1,376 B]
Get:77 https://packagecloud.io/computology/apt-backport/ubuntu trusty/main amd64 Packages [3,628 B]
Get:78 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty-backports/multiverse Translation-en [1,165 B]
Get:79 http://security.ubuntu.com/ubuntu trusty-security/multiverse Sources [3,068 B]
Get:80 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/main Sources [1,335 kB]
Get:81 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/restricted Sources [5,335 B]
Get:82 http://security.ubuntu.com/ubuntu trusty-security/main amd64 Packages [1,000 kB]
Get:83 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/universe Sources [7,926 kB]
Get:84 https://packagecloud.io/computology/apt-backport/ubuntu trusty/main i386 Packages [848 B]
Get:85 http://ppa.launchpad.net/couchdb/stable/ubuntu trusty Release [15.1 kB]
Get:86 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/multiverse Sources [211 kB]
Get:87 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/main amd64 Packages [1,743 kB]
Get:88 https://packagecloud.io/github/git-lfs/ubuntu trusty/main Sources [20 B]
Get:89 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/main i386 Packages [1,739 kB]
Get:90 http://security.ubuntu.com/ubuntu trusty-security/main i386 Packages [912 kB]
Get:91 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/restricted amd64 Packages [16.0 kB]
Get:92 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/restricted i386 Packages [16.4 kB]
Get:93 https://packagecloud.io/github/git-lfs/ubuntu trusty/main amd64 Packages [7,433 B]
Get:94 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/universe amd64 Packages [7,589 kB]
Get:95 http://security.ubuntu.com/ubuntu trusty-security/main Translation-en [525 kB]
Get:96 http://security.ubuntu.com/ubuntu trusty-security/restricted amd64 Packages [18.1 kB]
Get:97 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/universe i386 Packages [7,597 kB]
Get:98 http://security.ubuntu.com/ubuntu trusty-security/restricted i386 Packages [17.8 kB]
Get:99 https://packagecloud.io/github/git-lfs/ubuntu trusty/main i386 Packages [7,192 B]
Get:100 http://security.ubuntu.com/ubuntu trusty-security/restricted Translation-en [3,272 B]
Get:101 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/multiverse amd64 Packages [169 kB]
Get:102 http://security.ubuntu.com/ubuntu trusty-security/universe amd64 Packages [368 kB]
Get:103 http://us-east-1.ec2.archive.ubuntu.com/ubuntu trusty/multiverse i386 Packages [172 kB]
Get:104 http://security.ubuntu.com/ubuntu trusty-security/universe i386 Packages [350 kB]
Get:105 https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu trusty/main Sources [20 B]
Get:106 http://security.ubuntu.com/ubuntu trusty-security/universe Translation-en [199 kB]
Get:107 https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu trusty/main amd64 Packages [7,165 B]
Get:108 http://security.ubuntu.com/ubuntu trusty-security/multiverse amd64 Packages [4,723 B]
Get:109 http://security.ubuntu.com/ubuntu trusty-security/multiverse i386 Packages [4,876 B]
Get:110 https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu trusty/main i386 Packages [7,165 B]
Get:111 http://security.ubuntu.com/ubuntu trusty-security/multiverse Translation-en [2,426 B]
Get:112 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu trusty/main amd64 Packages [1,844 B]
Get:113 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu trusty/main i386 Packages [1,844 B]
Get:114 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu trusty/main Translation-en [990 B]
Get:115 http://ppa.launchpad.net/git-core/ppa/ubuntu trusty/main amd64 Packages [3,486 B]
Get:116 http://ppa.launchpad.net/git-core/ppa/ubuntu trusty/main i386 Packages [3,484 B]
Get:117 http://ppa.launchpad.net/git-core/ppa/ubuntu trusty/main Translation-en [2,332 B]
Get:118 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty/main amd64 Packages [7,571 B]
Get:119 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty/main i386 Packages [7,700 B]
Get:120 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty/main Translation-en [2,388 B]
Get:121 http://ppa.launchpad.net/pollinate/ppa/ubuntu trusty/main amd64 Packages [430 B]
Get:122 http://ppa.launchpad.net/pollinate/ppa/ubuntu trusty/main i386 Packages [430 B]
Get:123 http://ppa.launchpad.net/pollinate/ppa/ubuntu trusty/main Translation-en [374 B]
Get:124 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main amd64 Packages [1,553 B]
Get:125 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main i386 Packages [1,553 B]
Get:126 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main Translation-en [834 B]
Get:127 http://ppa.launchpad.net/couchdb/stable/ubuntu trusty Release.gpg [316 B]
Get:128 http://ppa.launchpad.net/couchdb/stable/ubuntu trusty/main amd64 Packages [985 B]
Get:129 http://ppa.launchpad.net/couchdb/stable/ubuntu trusty/main i386 Packages [985 B]
Get:130 http://ppa.launchpad.net/couchdb/stable/ubuntu trusty/main Translation-en [644 B]
Fetched 39.6 MB in 8s (4,535 kB/s)
Reading package lists...
W: GPG error: http://repo.mysql.com/apt/ubuntu trusty InRelease: The following signatures were invalid: KEYEXPIRED 1550412832  KEYEXPIRED 1550412832  KEYEXPIRED 1550412832
W: The repository 'http://repo.mysql.com/apt/ubuntu trusty InRelease' is not signed.
W: GPG error: https://packagecloud.io/github/git-lfs/ubuntu trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6B05F25D762E3157
W: The repository 'https://packagecloud.io/github/git-lfs/ubuntu trusty InRelease' is not signed.
W: There is no public key available for the following key IDs:
6B05F25D762E3157  
W: http://ppa.launchpad.net/couchdb/stable/ubuntu/dists/trusty/Release.gpg: Signature by key 15866BAFD9BCC4F3C1E0DFC7D69548E1C17EAB57 uses weak digest algorithm (SHA1)
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install mysql-server mysql-client" failed and exited with 100 during .
Your build has been stopped.

我并没有尝试从 apt-get 安装我自己的软件包。而且问题每个月都会出现和消失几次

最佳答案

当我尝试安装旧版安装程序 mysql-apt-config_0.8.6-1_all.deb 时,我在 Debian 9.4stretch 上遇到以下错误

W:GPG 错误:http://repo.mysql.com/apt/debian stretch InRelease:以下签名无效:EXPKEYSIG 8C718D3B5072E1F5 MySQL 发布工程 E:存储库'http://repo.mysql.com/apt/debian stretch InRelease' 未签名。 N:从这样的存储库进行更新无法安全地完成,因此默认情况下被禁用。 N:有关存储库创建和用户配置详细信息,请参阅 apt-secure(8) 联机帮助页。

但是我使用 apt-get 和 gdebi-core 来安装 mysql 而不是 mariadb。我猜这个过程会和 Ubuntu 类似。如果您愿意跳出脚本范围,以下内容可能会有所帮助。

这将为您提供截至 2019 年最新的带有最新签名 key 的 mysql 软件包。如果您发现签名无效或过期,您始终可以从这里获取最新的安装程序 https://dev.mysql.com/downloads/mysql/ )

wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

apt-get install gdebi-core

gdebi mysql-apt-config_0.8.12-1_all.deb

******************************** 在向导中 ************** **************************************

配置 mysql-apt-config

您希望配置哪个 MySQL 产品?

选择MySQL服务器和集群(当前选择:mysql-5.7) 标签 选择确定

然后按 Tab 键确定并按 Enter

配置 mysql-apt-config

您希望收到哪个服务器版本?

选择mysql 5.7

然后按 Tab 键确定并按 Enter


您始终可以通过直接编辑/etc/apt/sources.list.d/mysql.list 源列表来查看您的选择手册。 安装MySQL服务器

apt update

apt install mysql-server

systemctl status mysql

应该显示类似的内容

systemctl 状态 mysql ● mysql.service - MySQL 社区服务器 已加载:已加载(/lib/systemd/system/mysql.service;已启用;供应商预设:已启用) Active:自 UTC 时间 2019-02-24 08:57:51 星期日起处于事件状态(正在运行); 10 分钟前 主PID:14787(mysqld) CGroup:/system.slice/mysql.service └─14787/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

2 月 24 日 08:57:51 test.com systemd[1]:启动 MySQL 社区服务器... 2 月 24 日 08:57:51 test.com systemd[1]:启动 MySQL 社区服务器。

这应该可以修复你的 mysql 安装。

关于travis-ci - Travis 构建失败并显示 "apt-get install failed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54746476/

相关文章:

protractor - BrowserStack + Protractor + TravisCi和安全的localhost服务器-配置

github - Travis CI - 如何推送到主分支?

ios - 在 Travis CI 上,iOS 应用程序代码如何签名并上传到 Apple TestFlight?

docker - 在 Travis CI 上缓存单个文件

android - 有没有办法在 Android Gradle 项目中只运行一组特定的仪器测试?

c++ - 如何使用 MATRIX_EVAL 启用基于编译器的构建矩阵行?

encoding - Travis 上传到 S3 存储桶时缺少编码

continuous-integration - 如何让 Travis-CI 显示构建 Artifact ?

docker - 如何立即保存在多阶段docker中创建的docker镜像?

javascript - Travis 失败,状态码为 127