我正在运行 Ubuntu Bionic。当我尝试通过 apt-get 安装某些内容时,我收到二进制输出的长错误:
sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
bridge-utils ubuntu-fan
0 upgraded, 0 newly installed, 2 to remove and 321 not upgraded.
2 not fully installed or removed.
After this operation, 252 kB disk space will be freed.
Do you want to continue? [Y/n]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_AU.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_AU.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 176441 files and directories currently installed.)
Removing ubuntu-fan (0.12.10) ...
ubuntu-fan: removing default /etc/network/fan configuration
Removing bridge-utils (1.5-15ubuntu1) ...
Setting up initramfs-tools (0.130ubuntu3.6) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for man-db (2.8.3-2) ...
Setting up linux-image-4.15.0-46-generic (4.15.0-46.49) ...
Processing triggers for initramfs-tools (0.130ubuntu3.6) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-46-generic
/boot/initrd.img-4.15.0-46-generic: line 1: 07070100000065000041ED0000000000000000000000025B07FAC000000000000000030000000100000000000000000000000700000000kernel07070100000066000041ED0000000000000000000000025B07FAC000000000000000030000000100000000000000000000000B00000000kernel/x8607070100000067000041ED0000000000000000000000025B07FAC000000000000000030000000100000000000000000000001500000000kernel/x86/microcode07070100000068000041ED0000000000000000000000025B07FAC000000000000000030000000100000000000000000000003600000000kernel/x86/microcode/.enuineIntel.align.0123456789abc07070100000069000081A40000000000000000000000015B07FAC000180C00000000030000000100000000000000000000002600000000kernel/x86/microcode/GenuineIntel.bin: No such file or directory
/boot/initrd.img-4.15.0-46-generic: line 1: ?ɗ??$?8?: No such file or directory
/boot/initrd.img-4.15.0-46-generic: line 1: $'\276M\327\253\035\240\336\377\272IW!\257\316OsS\263\371\216\203ʰ\320': command not found
/boot/initrd.img-4.15.0-46-generic: line 2: $'R\300\251\3421^\331\375ɟ\220\202\222,\235t\320@\037\004\356Eq\356X\213M\230,a\251\2079\315\341\205,\230\270\211\213K\315\f~?A\227\300a\373': command not found
/boot/initrd.img-4.15.0-46-generic: line 2: $'\242,\024Py\266\264\001\353\223y$\273w': command not found
/boot/initrd.img-4.15.0-46-generic: line 13: $'\317\025\030\244\0348\205\3042\213': command not found
/boot/initrd.img-4.15.0-46-generic: command substitution: line 13: unexpected EOF while looking for matching `''
/boot/initrd.img-4.15.0-46-generic: command substitution: line 16: syntax error: unexpected end of file
/boot/initrd.img-4.15.0-46-generic: line 13: $'\255\v#\376ߏ': command not found
/boot/initrd.img-4.15.0-46-generic: line 13: ^?: No such file or directory
/boot/initrd.img-4.15.0-46-generic: command substitution: line 14: syntax error near unexpected token `)'
/boot/initrd.img-4.15.0-46-generic: command substitution: line 14: `
??CL
6Ǩrq)Ym??#}|???$rt#?0D(?l?????5!T???hW?q?q̼3P???l??7 >?'
/boot/initrd.img-4.15.0-46-generic: line 13: $'\317\025\030\244\0348\205\3042\213': command not found
/boot/initrd.img-4.15.0-46-generic: command substitution: line 13: unexpected EOF while looking for matching `''
/boot/initrd.img-4.15.0-46-generic: command substitution: line 16: syntax error: unexpected end of file
/boot/initrd.img-4.15.0-46-generic: line 13: $'\255\v#\376ߏ': command not found
/boot/initrd.img-4.15.0-46-generic: line 13: ^?: No such file or directory
/boot/initrd.img-4.15.0-46-generic: command substitution: line 14: syntax error near unexpected token `)'
/boot/initrd.img-4.15.0-46-generic: command substitution: line 14: `
??CL
6Ǩrq)Ym??#}|???$rt#?0????Q?*??P۠̂?e? ???I?ó?E? ۜY?.L?E9G???g???E?u:????'
/boot/initrd.img-4.15.0-46-generic: command substitution: line 14: syntax error near unexpected token `)'
/boot/initrd.img-4.15.0-46-generic: command substitution: line 14: `ȗhF0???y4+??{,??V?Рrr?t?k@??j?
???
???q?=Fi???L??Λ??1df??g?1{+?.??"z"GZU]Q????A??ژ:Y|??H)֮?(?????i?G???$???&?#Ȱ?5q?|?,ࡲ???z?L?b??$-??I7tN?h
???#?|?ޙ?q??E:?b?
2????q?????f???a?f:???4?d?1n'
/boot/initrd.img-4.15.0-46-generic: line 13: $'*\027h\227\355\E': command not found
Bn?B?N?2!3??F#s??Zӝ?h?$?????4???;?9?ڗ~-?A??-?0ں????J?S\??[?H?/??,?9!?KA??-Wg/;rjLL?ɯ?M鸧? 5ͪP~??????ħ? ??&\???v?8f??
d?
͖??GޤJ?*???^??????ox#8??\*ݚ??7?yk?-ן?j&y????#??sl??2????k?N??bHV?f
?\?]????????-A??6@6??j?鱈?xW??|#,??W?????wK????sM?tT??;/????l?B9???1?'?y??dqf????Lmi>?p?T?q؍z?R??????*?4??%???U?[ZL?^?lҰˠ????p]?x?L?Q]??S0?$?d?/???(?8?r ??E??|K;p?r/????MU??H0D
???觑
?K&????}??v*???+?
?i???? ?˿)
??%??P?P???u?z?y?????p?E25
$?????z??s?
l?rPA3???j? n?r?T?jZ߈?PiEbU)?ɭ??\?v?3'??3?l?b???Ѡ??E?0\'????????,?:nx?o?S?y??mM?A%p
HR?
Q: No such file or directory
/boot/initrd.img-4.15.0-46-generic: line 13: $'{\234:\EhWW\b:H\257\200\240\003\224': command not found
/boot/initrd.img-4.15.0-46-generic: line 13: $']\004\001C\262{\361j+i': command not found
/boot/initrd.img-4.15.0-46-generic: command substitution: line 13: syntax error near unexpected token `;'
/boot/initrd.img-4.15.0-46-generic: command substitution: line 13: `;?5?????? pAWI???H?]գ?)?X!?p!FԋR?:{??YL???cGE??{?p?\f,)??=?{??C???%??^??4-?m<?????????'?osi???~????|7?x?NK????ޘ'?? O**?B?s
/boot/initrd.img-4.15.0-46-generic: command substitution: line 13: syntax error near unexpected token `)'
/boot/initrd.img-4.15.0-46-generic: command substitution: line 13: `l?X9a????Ռ?????O'3?U?M?c??BtJ??d?|???.???1?ƉHcT?>???h??1.011i?l??É?L3Cb?k?0??V?,?!?<S??:p?~??)??Tݮ?vq+?~
?-??G?c#?('S?)??\S:?s??~???d?eߛ???&?{??TL?em?d?
答案1
检查 /etc/default/locale 中的内容 似乎系统不知道 en_AU 是什么。
我可以重现它的方式:
root@x:/# LANG="en_US.UTF-8" perl -e exit
root@x:/# LANG="en_AU.UTF-8" perl -e exit
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LANG = "en_AU.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
你可以尝试这些:
sudo dpkg-reconfigure locales
sudo locale-gen
或者将 /etc/default/locale 行中的 LANG 更改为 LANG="en_US.UTF-8"
之后可能需要注销/登录。