如何在Travis中的Ubuntu 12.04(精确)上安装libc ++?

时间:2016-05-16 14:48:21

标签: ubuntu ubuntu-12.04 travis-ci libc++

Travis Ubuntu-precise apt whitelist中列出了包libc ++ - dev,我尝试通过

安装
# .travis.yml
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    - kubuntu-backports
    - llvm-toolchain-precise
    packages:
    - g++-4.8
    - cmake
    - libc++-dev

Travis工作的APT步骤中发生了什么

$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install g++-4.8 cmake libc++-dev
Reading package lists...
Building dependency tree...
Reading state information...
libc-dev-bin is already the newest version.
libc-dev-bin set to manually installed.
libc6-dev is already the newest version.
libc6-dev set to manually installed.
The following package was automatically installed and is no longer required:
  libxmlrpc-core-c3
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  cmake-data cpp-4.8 emacsen-common gcc-4.8 gcc-4.8-base gcc-6-base libasan0
  libatomic1 libc6-armel-cross libc6-armhf-cross libcloog-isl4 libgcc-4.8-dev
  libgcc1 libgcc1-armel-cross libgcc1-armhf-cross libgomp1 libisl10 libitm1
  libpurelibc1 libquadmath0 libstdc++-4.8-dev libstdc++6 libtsan0
Suggested packages:
  codeblocks eclipse gcc-4.8-locales dietlibc-doc g++-4.8-multilib gcc-4.8-doc
  libstdc++6-4.8-dbg gcc-4.8-multilib libmudflap0-4.8-dev libgcc1-dbg
  libgomp1-dbg libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg
  libbacktrace1-dbg libquadmath0-dbg libmudflap0-dbg binutils-gold
  libstdc++-4.8-doc
The following NEW packages will be installed:
  cpp-4.8 dietlibc-dev g++-4.8 gcc-4.8 gcc-4.8-base gcc-6-base libasan0
  libatomic1 libc6-armel-cross libc6-armhf-cross libc6-dev-armel-cross
  libc6-dev-armhf-cross libcloog-isl4 libgcc-4.8-dev libgcc1-armel-cross
  libgcc1-armhf-cross libisl10 libitm1 libklibc-dev libowfat-dietlibc-dev
  libpurelibc-dev libpurelibc1 libstdc++-4.8-dev libtsan0
  linux-libc-dev-armel-cross linux-libc-dev-armhf-cross
The following packages will be upgraded:
  cmake cmake-data emacsen-common libgcc1 libgomp1 libquadmath0 libstdc++6
  linux-libc-dev
8 upgraded, 26 newly installed, 0 to remove and 242 not upgraded.
Need to get 43.6 MB of archives.
After this operation, 77.1 MB of additional disk space will be used.

因此,您可以看到在安装命令行之后不再提及libc ++ - dev。会发生什么是添加了以下包:

  • 的libc-dev的槽
  • 的libc6-dev的
  • 的libc6-ARMEL交
  • 的libc6-armhf交
  • 中的libgcc1-ARMEL交
  • 中的libgcc1-armhf交
  • libpurelibc1

所以我猜有一些正则表达式魔术正在进行(libc ++ - dev是否匹配libc6-dev?)。

那么,如何在Travis上安装libc ++ - dev?

1 个答案:

答案 0 :(得分:1)

根本原因是sources下列出的存储库不提供libc ++ - dev,因此您无法安装该软件包(至少不能安装这些软件包)。

当一个包不存在时,apt-get和apt(不是aptitude)会回退到将该名称解释为匹配包含正则表达式的所有包的正则表达式。如果您不喜欢这样,可以将包名称表示为正则表达式:^libc\+\+-dev$