无法安装locate或mlocate

无法安装locate或mlocate

我全新安装了 Ubuntu 12.04.3 LTS

毁灭cat /etc/apt/sources.list

显示:

deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse

但如果我跑,sudo apt-get update && sudo apt-get install mlocate locate
我就会

Package locate is a virtual package provided by:
  locate:i386 4.4.2-4ubuntu1 [Not candidate version]

E: Package 'mlocate' has no installation candidate
E: Package 'locate' has no installation candidate

请帮忙!我从来没有意识到我有多么依赖 find 命令。

欢呼吧,保罗

更新回答@braiam

#apt-cache policy locate mlocate
locate:
  Installed: (none)
  Candidate: (none)
  Package pin: 4.4.2-4ubuntu1
  Version table:
     4.4.2-4ubuntu1 -10
        500 http://archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
mlocate:
  Installed: (none)
  Candidate: (none)
  Package pin: 0.23.1-1ubuntu2
  Version table:
     0.23.1-1ubuntu2 -10
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages




#uname -a
Linux xxxx 3.0.20-xenU #1 SMP Wed May 15 04:27:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

第二次更新回答@braiam

:~# dpkg --print-foreign-architectures
i386
:~# cat /var/lib/dpkg/arch
amd64
i386

第三次更新回答@braiam

sudo apt-get update
Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
Hit http://archive.ubuntu.com precise Release.gpg    
Get:2 http://security.ubuntu.com precise-security Release [49.6 kB]
Get:3 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Hit http://archive.ubuntu.com precise Release                   
Get:4 http://archive.ubuntu.com precise-updates Release [49.6 kB]               
Get:5 http://security.ubuntu.com precise-security/main amd64 Packages [342 kB]
Hit http://archive.ubuntu.com precise/main amd64 Packages          
Hit http://archive.ubuntu.com precise/restricted amd64 Packages
Hit http://archive.ubuntu.com precise/universe amd64 Packages          
Get:6 http://security.ubuntu.com precise-security/restricted amd64 Packages [4,627 B]
Hit http://archive.ubuntu.com precise/multiverse amd64 Packages        
Get:7 http://security.ubuntu.com precise-security/universe amd64 Packages [85.2 kB]
Hit http://archive.ubuntu.com precise/main i386 Packages               
Get:8 http://security.ubuntu.com precise-security/multiverse amd64 Packages [2,439 B]
Hit http://archive.ubuntu.com precise/restricted i386 Packages         
Get:9 http://security.ubuntu.com precise-security/main i386 Packages [360 kB]
Hit http://archive.ubuntu.com precise/universe i386 Packages
Hit http://archive.ubuntu.com precise/multiverse i386 Packages
Hit http://archive.ubuntu.com precise/main TranslationIndex
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise/restricted TranslationIndex
Hit http://archive.ubuntu.com precise/universe TranslationIndex
Get:10 http://archive.ubuntu.com precise-updates/main amd64 Packages [708 kB]                                                                                                                                                 
Get:11 http://security.ubuntu.com precise-security/restricted i386 Packages [4,620 B]                                                                                                                                         
Get:12 http://security.ubuntu.com precise-security/universe i386 Packages [88.9 kB]                                                                                                                                           
Get:13 http://security.ubuntu.com precise-security/multiverse i386 Packages [2,635 B]                                                                                                                                         
Hit http://security.ubuntu.com precise-security/main TranslationIndex                                                                                                                                                         
Hit http://security.ubuntu.com precise-security/multiverse TranslationIndex                                                                                                                                                   
Hit http://security.ubuntu.com precise-security/restricted TranslationIndex                                                                                                                                                   
Hit http://security.ubuntu.com precise-security/universe TranslationIndex                                                                                                                                                     
Get:14 http://archive.ubuntu.com precise-updates/restricted amd64 Packages [11.5 kB]                                                                                                                                          
Hit http://security.ubuntu.com precise-security/main Translation-en                                                                                                                                                           
Get:15 http://archive.ubuntu.com precise-updates/universe amd64 Packages [222 kB]                                                                                                                                             
Hit http://security.ubuntu.com precise-security/multiverse Translation-en                                                                                                                                                     
Hit http://security.ubuntu.com precise-security/restricted Translation-en                                                                                                                                                     
Hit http://security.ubuntu.com precise-security/universe Translation-en                                                                                                                                                       
Get:16 http://archive.ubuntu.com precise-updates/multiverse amd64 Packages [14.0 kB]                                                                                                                                          
Get:17 http://archive.ubuntu.com precise-updates/main i386 Packages [729 kB]                                                                                                                                                  
Get:18 http://archive.ubuntu.com precise-updates/restricted i386 Packages [11.4 kB]                                                                                                                                           
Get:19 http://archive.ubuntu.com precise-updates/universe i386 Packages [226 kB]                                                                                                                                              
Get:20 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [14.2 kB]                                                                                                                                           
Hit http://archive.ubuntu.com precise-updates/main TranslationIndex                                                                                                                                                           
Hit http://archive.ubuntu.com precise-updates/multiverse TranslationIndex                                                                                                                                                     
Hit http://archive.ubuntu.com precise-updates/restricted TranslationIndex                                                                                                                                                     
Hit http://archive.ubuntu.com precise-updates/universe TranslationIndex                                                                                                                                                       
Hit http://archive.ubuntu.com precise/main Translation-en                                                                                                                                                                     
Hit http://archive.ubuntu.com precise/multiverse Translation-en                                                                                                                                                               
Hit http://archive.ubuntu.com precise/restricted Translation-en                                                                                                                                                               
Hit http://archive.ubuntu.com precise/universe Translation-en                                                                                                                                                                 
Hit http://archive.ubuntu.com precise-updates/main Translation-en                                                                                                                                                             
Hit http://archive.ubuntu.com precise-updates/multiverse Translation-en                                                                                                                                                       
Hit http://archive.ubuntu.com precise-updates/restricted Translation-en                                                                                                                                                       
Hit http://archive.ubuntu.com precise-updates/universe Translation-en                                                                                                                                                         
Fetched 2,925 kB in 19s (150 kB/s)                                                                                                                                                                                            
Reading package lists... Done

答案1

创建/var/lib/dpkg/arch包含以下文本的文件:

amd64
i386

然后执行,sudo apt-get update现在您可以重新开始安装。

答案2

经过进一步调查,结果发现该功能已被托管公司禁用。

默认情况下,mlocate 未安装,如果默认安装,则禁用。原因是 cron 任务和 IO 负载会放在服务器上,这可能会影响同一主机上的其他服务器。IO 是主机速度变慢的最大原因,这就是我们相当严格的原因。我们更愿意鼓励人们使用 find 命令来查找内容,例如 find / -iname "某名

当试图弄清楚这一点时,我首先求助于谷歌,但我无法找到有关此问题的任何有用信息。

我已将此添加为答案,以便希望将来在 Google 上搜索“无法安装定位”的人能够知道先询问他们的托管公司!

相关内容