11

vagrant provision今天正在运行,但失败并出现以下错误:

Package configuration┌──────────────────────────┤ Configuring grub-pc ├──────────────────────────┐│││ 
The GRUB boot loader was previously installed to a disk that is no
││ longer present, or whose unique identifier has changed for some reason.   
││ It is important to make sure that the installed GRUB core image stays in  
││ sync with GRUB modules and grub.cfg. Please check again to make sure
││ that GRUB is written to the appropriate boot devices.
││││ If you're unsure which drive is designated as boot drive by your BIOS,    
││ it is often a good idea to install GRUB to all of them.
││││ Note: it is possible to install GRUB to partition boot records as well,  
││ and some appropriate partitions are offered here. However, this forces   
││ GRUB to use the blocklist mechanism, which makes it less reliable, and   
││ therefore is not recommended.
││││<Ok>│││└───────────────────────────────────────────────────────────────────────────┘

但是,令我惊讶的是,它开始以一种非常奇怪的编码打印堆栈跟踪......

STDERR: F▒␋┌␊␍ ├⎺ ⎺⎻␊┼ ├␊⎼└␋┼▒┌.␍␊␉␌⎺┼°: ┬␤␋⎻├▒␋┌ ⎺┤├⎻┤├ ├␤␊ ▒␉⎺┴␊ ␊⎼⎼⎺⎼⎽, ±␋┴␋┼± ┤⎻!
␍⎻┐±: ␊⎼⎼⎺⎼ ⎻⎼⎺␌␊⎽⎽␋┼± ±⎼┤␉-⎻␌ (--␌⎺┼°␋±┤⎼␊):
 ⎽┤␉⎻⎼⎺␌␊⎽⎽ ␋┼⎽├▒┌┌␊␍ ⎻⎺⎽├-␋┼⎽├▒┌┌▒├␋⎺┼ ⎽␌⎼␋⎻├ ⎼␊├┤⎼┼␊␍ ␊⎼⎼⎺⎼ ␊│␋├ ⎽├▒├┤⎽ 255
E⎼⎼⎺⎼⎽ ┬␊⎼␊ ␊┼␌⎺┤┼├␊⎼␊␍ ┬␤␋┌␊ ⎻⎼⎺␌␊⎽⎽␋┼±:
 ±⎼┤␉-⎻␌
E: S┤␉-⎻⎼⎺␌␊⎽⎽ /┤⎽⎼/␉␋┼/␍⎻┐± ⎼␊├┤⎼┼␊␍ ▒┼ ␊⎼⎼⎺⎼ ␌⎺␍␊ (1)
---- E┼␍ ⎺┤├⎻┤├ ⎺° ▒⎻├-±␊├ ┤⎻±⎼▒␍␊ -≤ ----
R▒┼ ▒⎻├-±␊├ ┤⎻±⎼▒␍␊ -≤ ⎼␊├┤⎼┼␊␍ 100


R␊⎽⎺┤⎼␌␊ D␊␌┌▒⎼▒├␋⎺┼:
---------------------
# I┼ /┴▒⎼/␌␤␊°/␌▒␌␤␊/␌⎺⎺┐␉⎺⎺┐⎽/␌⎺└└⎺┼-⎽⎺°├┬▒⎼␊/⎼␊␌␋⎻␊⎽/␍␊°▒┤┌├.⎼␉

 49: ␊│␊␌┤├␊ "▒⎻├-±␊├-┤⎻±⎼▒␍␊-≤" ␍⎺
 50:   ␌⎺└└▒┼␍ "▒⎻├-±␊├ ┤⎻±⎼▒␍␊ -≤" 
 51: ␊┼␍


 C⎺└⎻␋┌␊␍ R␊⎽⎺┤⎼␌␊:
------------------
# D␊␌┌▒⎼␊␍ ␋┼ /┴▒⎼/␌␤␊°/␌▒␌␤␊/␌⎺⎺┐␉⎺⎺┐⎽/␌⎺└└⎺┼-⎽⎺°├┬▒⎼␊/⎼␊␌␋⎻␊⎽/␍␊°▒┤┌├.⎼␉:49:␋┼ ◆°⎼⎺└_°␋┌␊'

␊│␊␌┤├␊("▒⎻├-±␊├-┤⎻±⎼▒␍␊-≤") ␍⎺
  ⎼␊├┤⎼┼⎽ 0
  ␌⎺└└▒┼␍ "▒⎻├-±␊├ ┤⎻±⎼▒␍␊ -≤"
  ▒␌├␋⎺┼ "⎼┤┼"
  ⎼␊␌␋⎻␊_┼▒└␊ "␍␊°▒┤┌├"
  ⎼␊├⎼≤_␍␊┌▒≤ 2
  ␌⎺⎺┐␉⎺⎺┐_┼▒└␊ "␌⎺└└⎺┼-⎽⎺°├┬▒⎼␊"
  ␉▒␌┐┤⎻ 5
  ⎼␊├⎼␋␊⎽ 0
␊┼␍

并且终端提示返回......以相同的编码!我的所有输入都转换为该编码(尽管大写字母照常出现)。

我的问题是:为什么 Vagrant 会更改我的终端窗口的编码,它是否与 GRUB 错误有关?

我在 Macbook Pro 上。

4

2 回答 2

10

如果您使用的是 apt-get upgrade/dist-upgrade,请尝试:

sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade

于 2014-06-11T14:37:22.390 回答
2

我为它写了一个函数。只需将其复制粘贴到您的配置脚本中:

function aptget {
  # to prevent encoding problem
  sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
    -o Dpkg::Options::="--force-confdef" \
    -o Dpkg::Options::="--force-confold" \
    $@
}

aptget update
aptget upgrade

注意:我已将此作为对@gustavohenrique 答案的评论发布,但它没有很好的评论格式。因此,尽管它是重复的答案,但我已将其发布为答案。它更多的是一种补充。抱歉打扰了。

于 2015-05-17T12:41:40.153 回答