apt-get upgrade 报错,有日志,请帮忙下!

最大的社区版本,Ubuntu的发源地
回复
头像
redhatlinux10
帖子: 773
注册时间: 2008-01-22 23:24
来自: 三亚
联系:

apt-get upgrade 报错,有日志,请帮忙下!

#1

帖子 redhatlinux10 » 2014-11-11 12:26

OS:Debian GNU/Linux 6.0.10 (squeeze) 64bit

代码: 全选

root@debian:/var/log#  sudo apt-get -o Acquire::http::proxy="http://10.114.8.164:9999/" upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 33, in <module>
    from ALChacks import *
  File "/usr/share/apt-listchanges/ALChacks.py", line 32, in <module>
    sys.stderr.write(_("Can't set locale; make sure $LC_* and $LANG are correct!\n"))
NameError: name '_' is not defined
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "zh_CN:zh",
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up gconf2 (2.28.1-6) ...
dpkg: error processing gconf2 (--configure):
 subprocess installed post-installation script returned error exit status 127
configured to not write apport reports
                                      dpkg: dependency problems prevent configuration of gdm3:
 gdm3 depends on gconf2 (>= 2.28.1-2); however:
  Package gconf2 is not configured yet.
dpkg: error processing gdm3 (--configure):
 dependency problems - leaving unconfigured
configured to not write apport reports
                                      Errors were encountered while processing:
 gconf2
 gdm3
E: Sub-process /usr/bin/dpkg returned an error code (1)

install 也有类似的错误,都是和gconf2相关的。

代码: 全选

root@debian:/var/log#  sudo apt-get -o Acquire::http::proxy="http://10.114.8.164:9999/" install gconf2
Reading package lists... Done
Building dependency tree
Reading state information... Done
gconf2 is already the newest version.
gconf2 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 33, in <module>
    from ALChacks import *
  File "/usr/share/apt-listchanges/ALChacks.py", line 32, in <module>
    sys.stderr.write(_("Can't set locale; make sure $LC_* and $LANG are correct!\n"))
NameError: name '_' is not defined
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "zh_CN:zh",
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up gconf2 (2.28.1-6) ...
dpkg: error processing gconf2 (--configure):
 subprocess installed post-installation script returned error exit status 127
configured to not write apport reports
                                      dpkg: dependency problems prevent configuration of gdm3:
 gdm3 depends on gconf2 (>= 2.28.1-2); however:
  Package gconf2 is not configured yet.
dpkg: error processing gdm3 (--configure):
 dependency problems - leaving unconfigured
configured to not write apport reports
                                      Errors were encountered while processing:
 gconf2
 gdm3
E: Sub-process /usr/bin/dpkg returned an error code (1)
update是正常的。
autoremove 和 autoclean 都试过了,问题还是存在。
请问该如何解决呢?谢谢!
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: apt-get upgrade 报错,有日志,请帮忙下!

#2

帖子 poloshiao » 2014-11-11 13:15

sudo apt-get -o
http://manpages.ubuntu.com/manpages/tru ... get.8.html
-o, --option
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options.
在 -o 後面 加個參數看看
头像
redhatlinux10
帖子: 773
注册时间: 2008-01-22 23:24
来自: 三亚
联系:

Re: apt-get upgrade 报错,有日志,请帮忙下!

#3

帖子 redhatlinux10 » 2014-11-11 14:15

poloshiao 写了:
sudo apt-get -o
http://manpages.ubuntu.com/manpages/tru ... get.8.html
-o, --option
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options.
在 -o 後面 加個參數看看
没有看懂你的意思,不过

代码: 全选

apt-get -o Foo::Bar=bar
不能直接运行的呀,没有子命令。。。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: apt-get upgrade 报错,有日志,请帮忙下!

#4

帖子 poloshiao » 2014-11-11 15:35

apt-get -o Foo::Bar=bar
http://zh.wikipedia.org/wiki/Foobar
術語foobar是一個常見的無名氏化名,常被作為「偽變數」使用。
意思是
Foo / Bar / bar 的位置 只是提醒你 用有意義的字串 取代該位置
至於 什麼是 有意義的字串 要看你正在作的事情而定
例如 使用 :: 搜尋
http://manpages.ubuntu.com/manpages/tru ... get.8.html
網頁 可以找到一些例子
头像
redhatlinux10
帖子: 773
注册时间: 2008-01-22 23:24
来自: 三亚
联系:

Re: apt-get upgrade 报错,有日志,请帮忙下!

#5

帖子 redhatlinux10 » 2014-11-11 17:30

poloshiao 写了:
apt-get -o Foo::Bar=bar
http://zh.wikipedia.org/wiki/Foobar
術語foobar是一個常見的無名氏化名,常被作為「偽變數」使用。
意思是
Foo / Bar / bar 的位置 只是提醒你 用有意義的字串 取代該位置
至於 什麼是 有意義的字串 要看你正在作的事情而定
例如 使用 :: 搜尋
http://manpages.ubuntu.com/manpages/tru ... get.8.html
網頁 可以找到一些例子
不管foobar是否是一个有意义的键or值,在我这里是一个合法的键/值呀。
而且我不明白的是,设置 -o 和我的问题又有什么关系呢?还请教!
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: apt-get upgrade 报错,有日志,请帮忙下!

#6

帖子 poloshiao » 2014-11-11 19:09

我不明白的是,设置 -o 和我的问题又有什么关系呢?还请教!
http://manpages.ubuntu.com/manpages/tru ... get.8.html
apt-get - APT package handling utility -- command-line interface
apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file] ... 後面省略
這個 manpage 網頁 說明 apt-get 指令的 使用大綱 也可以理解為使用規定格式
雙掛號內 表示 可以有 可以沒有的 選項 或 稱參數
但是 一旦你選擇了 -o=config_string
在 -o 後面 最好 加上 config_string 的 選項

如果沒有指明 config_string 就隨機抓一個(來設定)
-o, --option
Set a Configuration Option; This will set an arbitrary configuration option.
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: apt-get upgrade 报错,有日志,请帮忙下!

#7

帖子 cnkilior » 2014-11-26 9:41

看起来像是环境变量有错误。你可以尝试update-locale
回复