Wednesday, December 25, 2013

[Linux Mint] Package 'xxxx' has no installation candidate

Few weeks back I changed my OS from Windows 7 to Mint Linux 15 due to unavoidable circumstances :-). I was trying to install "vim" editor using shell and I saw the following as the output for my command.

eranda@eranda ~ $ sudo apt-get install vim
[sudo] password for eranda: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vim' has no installation candidate

Really....!!! "vim" has no installable candidate for Mint? I realize that this should be a problem with my aptitude. So as my first step I tried executing aptitude update (as everybody else may do) and got the following output.


eranda@eranda ~ $ sudo apt-get update
Hit http://dl.google.com stable Release.gpg
Hit http://dl.google.com stable Release                                        
Hit http://dl.google.com stable/main amd64 Packages                            
Get:1 http://packages.linuxmint.com olivia Release.gpg [198 B]                 
Hit http://dl.google.com stable/main i386 Packages                             
Ign http://security.ubuntu.com olivia-security Release.gpg                     
Get:2 http://packages.linuxmint.com olivia Release [18.5 kB]                   
Ign http://security.ubuntu.com olivia-security Release                         
Ign http://archive.ubuntu.com olivia Release.gpg                               
Ign http://archive.canonical.com olivia Release.gpg                            
Get:3 http://packages.linuxmint.com olivia/main amd64 Packages [23.5 kB]       
Ign http://archive.ubuntu.com olivia-updates Release.gpg                       
Ign http://archive.canonical.com olivia Release                                
Ign http://dl.google.com stable/main Translation-en_US                         
Ign http://dl.google.com stable/main Translation-en                            
Get:4 http://packages.linuxmint.com olivia/upstream amd64 Packages [9,249 B]   
Ign http://archive.ubuntu.com olivia Release                                   
Get:5 http://packages.linuxmint.com olivia/import amd64 Packages [39.3 kB]     
Ign http://archive.ubuntu.com olivia-updates Release                           
Get:6 http://packages.linuxmint.com olivia/main i386 Packages [23.5 kB]        
Get:7 http://packages.linuxmint.com olivia/upstream i386 Packages [9,237 B]    
Get:8 http://packages.linuxmint.com olivia/import i386 Packages [40.2 kB]      
Err http://archive.canonical.com olivia/partner amd64 Packages                 
  404  Not Found [IP: 91.189.92.191 80]
Err http://archive.canonical.com olivia/partner i386 Packages                  
  404  Not Found [IP: 91.189.92.191 80]
Ign http://packages.linuxmint.com olivia/import Translation-en_US              
Ign http://packages.linuxmint.com olivia/import Translation-en        
Ign http://packages.linuxmint.com olivia/main Translation-en_US       
Ign http://packages.linuxmint.com olivia/main Translation-en          
Ign http://archive.canonical.com olivia/partner Translation-en_US     
Ign http://packages.linuxmint.com olivia/upstream Translation-en_US   
Ign http://packages.linuxmint.com olivia/upstream Translation-en      
Ign http://archive.canonical.com olivia/partner Translation-en        
Err http://security.ubuntu.com olivia-security/main amd64 Packages             
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/restricted amd64 Packages       
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/universe amd64 Packages         
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/multiverse amd64 Packages       
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/main i386 Packages              
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/restricted i386 Packages        
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/universe i386 Packages          
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com olivia-security/multiverse i386 Packages        
  404  Not Found [IP: 91.189.91.15 80]
Ign http://security.ubuntu.com olivia-security/main Translation-en_US          
Ign http://security.ubuntu.com olivia-security/main Translation-en             
Ign http://security.ubuntu.com olivia-security/multiverse Translation-en_US    
Ign http://security.ubuntu.com olivia-security/multiverse Translation-en       
Ign http://security.ubuntu.com olivia-security/restricted Translation-en_US    
Ign http://security.ubuntu.com olivia-security/restricted Translation-en       
Ign http://security.ubuntu.com olivia-security/universe Translation-en_US      
Ign http://security.ubuntu.com olivia-security/universe Translation-en         
Err http://archive.ubuntu.com olivia/main amd64 Packages                       
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/restricted amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/universe amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/multiverse amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/main i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/restricted i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/universe i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia/multiverse i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Ign http://archive.ubuntu.com olivia/main Translation-en_US
Ign http://archive.ubuntu.com olivia/main Translation-en
Ign http://archive.ubuntu.com olivia/multiverse Translation-en_US
Ign http://archive.ubuntu.com olivia/multiverse Translation-en
Ign http://archive.ubuntu.com olivia/restricted Translation-en_US
Ign http://archive.ubuntu.com olivia/restricted Translation-en
Ign http://archive.ubuntu.com olivia/universe Translation-en_US
Ign http://archive.ubuntu.com olivia/universe Translation-en
Err http://archive.ubuntu.com olivia-updates/main amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/restricted amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/universe amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/multiverse amd64 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/main i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/restricted i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/universe i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com olivia-updates/multiverse i386 Packages
  404  Not Found [IP: 91.189.92.202 80]
Ign http://archive.ubuntu.com olivia-updates/main Translation-en_US
Ign http://archive.ubuntu.com olivia-updates/main Translation-en
Ign http://archive.ubuntu.com olivia-updates/multiverse Translation-en_US
Ign http://archive.ubuntu.com olivia-updates/multiverse Translation-en
Ign http://archive.ubuntu.com olivia-updates/restricted Translation-en_US
Ign http://archive.ubuntu.com olivia-updates/restricted Translation-en
Ign http://archive.ubuntu.com olivia-updates/universe Translation-en_US
Ign http://archive.ubuntu.com olivia-updates/universe Translation-en
Fetched 164 kB in 26s (6,152 B/s)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/main/binary-i386/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/universe/binary-i386/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/olivia-security/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/olivia/partner/binary-amd64/Packages  404  Not Found [IP: 91.189.92.191 80]

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/olivia/partner/binary-i386/Packages  404  Not Found [IP: 91.189.92.191 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/main/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/main/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/olivia-updates/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.202 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

As the output say it should be a problem of my aptitude source list. Content of my /etc/apt/sources.list was as below.

           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com olivia main upstream import backport
           deb http://archive.ubuntu.com/ubuntu olivia main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu olivia-updates main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ olivia-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ olivia partner 

So I further look for a solution and I found the LinuxMint bug /etc/apt/source.list specifies "olivia" rather than "raring" for all sources: Mint 15 Cinnamon 64-bit No Codecs ISO install. As specified in the bug I changed my /etc/apt/sources.list was as below.

           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com olivia main upstream import backport
           deb http://archive.ubuntu.com/ubuntu raring main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ raring partner

After changing this I was able to install popular tools for Linux using the aptitude. Hopes this helps you as well.