对于shell配置者,vagrant supressing non-zero exit staus

Pet*_*vic 5 shell apt-get vagrant

我在流浪汉中有一个脚本供应商.我的盒子是ubuntu 64bit Precise.我的脚本的相关行看起来像这样:

sudo bash -c 'echo "deb https://oss.oracle.com/debian/ unstable main non-free" >/etc/apt/sources.list.d/oracle.list'
wget -q https://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -

sudo apt-get update -qq
Run Code Online (Sandbox Code Playgroud)

错误代码是:

W: GPG error: https://oss.oracle.com unstable Release: The following signatures were invalid: KEYEXPIRED 1378511808 KEYEXPIRED 1378511808 KEYEXPIRED 1378511808
W: Failed to fetch https://oss.oracle.com/debian/dists/unstable/main/binary-amd64/Packages  The requested URL returned error: 404

W: Failed to fetch https://oss.oracle.com/debian/dists/unstable/non-free/binary-amd64/Packages  The requested URL returned error: 404

E: Some index files failed to download. They have been ignored, or old ones used instead.
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
Run Code Online (Sandbox Code Playgroud)

问题是尽管我知道repo已经过期密钥而不是64位架构(仅限32位).我仍然想从它安装相关的包(这是可能的,使用:) <package_name>:i386.但是在更新期间由于非退出状态流浪汉停止并且不再继续我的脚本.

是否有一种方法(流浪者或apt-get侧面)让流浪者开心并继续执行我的剧本?

Igo*_*bin 15

您可以使用以下命令将错误状态强制为零; true:

sudo sh -c "apt-get update -qq ; true"
Run Code Online (Sandbox Code Playgroud)