+ -
当前位置:首页 → 问答吧 → apt問題

apt問題

时间:2005-04-07

来源:互联网

我學校的機子,裝了Debian Woody,好久都沒有人碰過了,
今天我打算把它升級到Sarge ,于是
#apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open ( 11 Resource temporarily unavailable)
E: Unable to lock the list directory
很奇怪,apt-get install 什麼都不成了(apt源沒錯的!!!!)
但是卻可以上網,上linuxsir,yahoo........
大家有沒有遇過這種情況?

作者: simon25hk   发布时间: 2005-04-07

是不是用普通用户运行的,或者是还有另一个apt程序在运行。

作者: zlbruce   发布时间: 2005-04-08

它为什么认为list不合法呢?

作者: wake_up   发布时间: 2005-04-08

我用root登入的
會不會是我曾經不正常關機,使得有些文件掉失了??

作者: simon25hk   发布时间: 2005-04-08

重启下再setup下看能不能解决

作者: upandup   发布时间: 2005-04-08

普通用户不能运行apt-get 的,登陆到root再运行

作者: shuxw   发布时间: 2005-04-08

apt或者dpkg的很多操作会在 /var/lib/apt/lists/下生成一个隐含文件“.lock”。如果该文件存在,他就会认为另一个此类操作正在进行。它就会报告以下错误:
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
你的问题好象是不能在那个目录下创建锁定文件。要检查对该目录是否有写权限。还要检查该文件是否存在。如果你确认没有另一个apt或者dpkg程序在运行,但锁定文件存在的话,你可以手动删除该文件再试。

还有一种可能就是apt在woody中的版本和在sarge中的版本对该部分的处理不一样的原故。这个纯属猜测。看看而已了

作者: ziyouwa   发布时间: 2005-04-08

用root删除/var/lib/apt/lists/lock就好了!它是个空文件不用怕呵呵删除了就能用了!

作者: zhy2111314   发布时间: 2005-04-08

我用了ifconfig,可能會有一點幫助
debian:~# ifconfig
eth0 Link encap:Ethernet HWaddr 6C:74:28:27:42:79
inet addr:192.168.2.119 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8078 errors:0 dropped:0 overruns:0 frame:0
TX packets:635 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1066057 (1.0 MiB) TX bytes:138347 (135.1 KiB)
Interrupt:11 Base address:0xa400

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:753 errors:0 dropped:0 overruns:0 frame:0
TX packets:753 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:38203 (37.3 KiB) TX bytes:38203 (37.3 KiB)

sl0 Link encap:Serial Line IP
inet addr:192.168.0.1 P-t-P:192.168.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
debian:~#

把那個lock刪除了(lock不是隱藏檔!!!!),再試了一下,是這種情況
debian:/var/lib/apt/lists# apt-get update
Err http://http.us.debian.org testing/main Packages
Something wicked happened resolving 'http.us.debian.org:http' (-3)
Err http://http.us.debian.org testing/main Release
Something wicked happened resolving 'http.us.debian.org:http' (-3)
Err http://http.us.debian.org testing/contrib Packages
Something wicked happened resolving 'http.us.debian.org:http' (-3)
Err http://http.us.debian.org testing/contrib Release
Something wicked happened resolving 'http.us.debian.org:http' (-3)
Err http://http.us.debian.org testing/non-free Packages
Something wicked happened resolving 'http.us.debian.org:http' (-3)
Err http://http.us.debian.org testing/non-free Release
Something wicked happened resolving 'http.us.debian.org:http' (-3)


另外...../lists文件夾里有一些奇怪的檔案,是什麼?淼???
debian:/var/lib/apt/lists# ls
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_contrib_binary-i386_Packages
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_contrib_binary-i386_Release
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_main_binary-i386_Packages
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_main_binary-i386_Release
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_non-US_contrib_binary-i386_Packages
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_non-US_contrib_binary-i386_Release
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_non-US_main_binary-i386_Packages
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-1%20(20031201)_dists_unstable_non-US_main_binary-i386_Release
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-2%20(20031201)_dists_unstable_contrib_binary-i386_Packages
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-2%20(20031201)_dists_unstable_contrib_binary-i386_Release
Debian%20GNU_Linux%203.0%20r2%20%5fWoody%5f%20-%20Official%20i386%20Binary-2%20(20031201)_dists_unstable_main_binary-i386_Packages
.....
.....

作者: simon25hk   发布时间: 2005-04-08

sorry, 上面的帖子我说错了,是/var/lib/apt/lists/lock文件,不是隐含的.
楼上的问题是不是访问不到http://http.us.debian.org, ping一下看看.
上面的那些文件是apt源的软件包信息文件. 每个源都有自己的Packages文件。里面是这个源所包含的所有软件包的信息。你可以用kate打开看看就知道了

作者: ziyouwa   发布时间: 2005-04-09

网络不通,配置网络先

作者: sfatsdu   发布时间: 2005-04-09

引用:
作者: sfatsdu
网络不通,配置网络先
不是啊,可以訪問yahoo,linuxsir,
我想不是网絡不通吧.

作者: simon25hk   发布时间: 2005-04-09

export LANG=POSIX
感觉那些奇怪的符号是locale设置为中文引起的。
只是猜测。

作者: sfatsdu   发布时间: 2005-04-09

热门下载

更多