升级到 18.10 后终端输出中出现多余的行

升级到 18.10 后终端输出中出现多余的行

从 18.04 升级到 18.10 后,我开始看到这样的行。出了什么问题?

$ sudo apt autoremove
Чтение списков пакетов… Готово
Построение дерева зависимостей       
Чтение информации о состоянии… Готово
2018/10/25 10:02:58.175716 main.go:158: argument "abort"'s "<смена ID>s" should be wrapped in <>s
2018/10/25 10:02:58.175829 main.go:158: argument "ack"'s "<файл подтверждения>s" should be wrapped in <>s
2018/10/25 10:02:58.176064 main.go:158: argument "tasks"'s "<смена ID>s" should be wrapped in <>s
2018/10/25 10:02:58.176142 main.go:158: argument "create-key"'s "<имя ключа>s" should be wrapped in <>s
2018/10/25 10:02:58.176210 main.go:158: argument "create-user"'s "<отослать>s" should be wrapped in <>s
2018/10/25 10:02:58.176277 main.go:158: argument "delete-key"'s "<имя ключа>s" should be wrapped in <>s
2018/10/25 10:02:58.176408 main.go:158: argument "export-key"'s "<имя ключа>s" should be wrapped in <>s
2018/10/25 10:02:58.176485 main.go:158: argument "find"'s "<запрос>s" should be wrapped in <>s
2018/10/25 10:02:58.176567 main.go:158: argument "get"'s "<ключ>s" should be wrapped in <>s
2018/10/25 10:02:58.176684 main.go:158: argument "interface"'s "<интерфейс>s" should be wrapped in <>s
2018/10/25 10:02:58.176773 main.go:158: argument "known"'s "<тип подтверждения>s" should be wrapped in <>s
2018/10/25 10:02:58.176798 main.go:158: argument "known"'s "<фильт заголовков>s" should be wrapped in <>s
2018/10/25 10:02:58.176889 main.go:158: argument "login"'s "<отослать>s" should be wrapped in <>s
2018/10/25 10:02:58.176992 main.go:158: argument "prepare-image"'s "<модель подтверждения>s" should be wrapped in <>s
2018/10/25 10:02:58.177020 main.go:158: argument "prepare-image"'s "<корневая директория>s" should be wrapped in <>s
2018/10/25 10:02:58.177139 main.go:158: argument "services"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.177206 main.go:158: argument "logs"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.177261 main.go:158: argument "start"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.177334 main.go:158: argument "stop"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.177399 main.go:158: argument "restart"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.177467 main.go:158: argument "set"'s "<конфигурационное значение>s" should be wrapped in <>s
2018/10/25 10:02:58.177560 main.go:158: argument "sign-build"'s "<имя файла>s" should be wrapped in <>s
2018/10/25 10:02:58.177963 main.go:158: argument "wait"'s "<ключ>s" should be wrapped in <>s
2018/10/25 10:02:58.178017 main.go:158: argument "watch"'s "<смена ID>s" should be wrapped in <>s
Обновлено 0 пакетов, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
2018/10/25 10:02:58.251189 main.go:158: argument "abort"'s "<смена ID>s" should be wrapped in <>s
2018/10/25 10:02:58.251259 main.go:158: argument "ack"'s "<файл подтверждения>s" should be wrapped in <>s
2018/10/25 10:02:58.251388 main.go:158: argument "tasks"'s "<смена ID>s" should be wrapped in <>s
2018/10/25 10:02:58.251423 main.go:158: argument "create-key"'s "<имя ключа>s" should be wrapped in <>s
2018/10/25 10:02:58.251468 main.go:158: argument "create-user"'s "<отослать>s" should be wrapped in <>s
2018/10/25 10:02:58.251492 main.go:158: argument "delete-key"'s "<имя ключа>s" should be wrapped in <>s
2018/10/25 10:02:58.251563 main.go:158: argument "export-key"'s "<имя ключа>s" should be wrapped in <>s
2018/10/25 10:02:58.251605 main.go:158: argument "find"'s "<запрос>s" should be wrapped in <>s
2018/10/25 10:02:58.251641 main.go:158: argument "get"'s "<ключ>s" should be wrapped in <>s
2018/10/25 10:02:58.251711 main.go:158: argument "interface"'s "<интерфейс>s" should be wrapped in <>s
2018/10/25 10:02:58.251749 main.go:158: argument "known"'s "<тип подтверждения>s" should be wrapped in <>s
2018/10/25 10:02:58.251766 main.go:158: argument "known"'s "<фильт заголовков>s" should be wrapped in <>s
2018/10/25 10:02:58.251817 main.go:158: argument "login"'s "<отослать>s" should be wrapped in <>s
2018/10/25 10:02:58.251884 main.go:158: argument "prepare-image"'s "<модель подтверждения>s" should be wrapped in <>s
2018/10/25 10:02:58.251900 main.go:158: argument "prepare-image"'s "<корневая директория>s" should be wrapped in <>s
2018/10/25 10:02:58.251963 main.go:158: argument "services"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.251999 main.go:158: argument "logs"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.252032 main.go:158: argument "start"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.252077 main.go:158: argument "stop"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.252110 main.go:158: argument "restart"'s "<сервис>s" should be wrapped in <>s
2018/10/25 10:02:58.252156 main.go:158: argument "set"'s "<конфигурационное значение>s" should be wrapped in <>s
2018/10/25 10:02:58.252207 main.go:158: argument "sign-build"'s "<имя файла>s" should be wrapped in <>s
2018/10/25 10:02:58.252453 main.go:158: argument "wait"'s "<ключ>s" should be wrapped in <>s
2018/10/25 10:02:58.252484 main.go:158: argument "watch"'s "<смена ID>s" should be wrapped in <>s

答案1

将语言环境设置为/etc/default/locale以下的最佳方式:

sudo update-locale LANG=en_US.UTF-8

检查更改cat /etc/default/locale

LANG=en_US.UTF-8
LC_COLLATE=C
LC_MESSAGES=C
LC_ALL=en_US.UTF-8

或者编辑 bash profiale /etc/bash.bashrc

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

答案2

在 Ubuntu-Mate 18.10 上从 apt 获得相同的输出。添加“LANG=C”前缀也可以解决这个问题。所以,这里有一个解决方法。

重命名 apt 和 apt-get 二进制文件:

cd /usr/bin
sudo mv apt apt_orig
sudo mv apt-get apt-get_orig

创建一个脚本“apt”(sudo nano apt),其内容如下:

#!/bin/bash
LANG=C apt_orig $*

sudo nano apt-get

#!/bin/bash
LANG=C apt-get_orig $*

然后使它们可执行:

sudo chmod +x apt apt-get

当 apt 和 apt-get 软件包更新时,这些可能会被覆盖。希望下一次更新可以解决这个问题 :) 也许有人可以提供更持久的解决方案。

相关内容