Home Linux Fixing error: Package packagename 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 ‘packagename’ has no installation candidate

Fixing error: Package packagename 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 ‘packagename’ has no installation candidate

by blackMORE

A common error in Linux

A very common error in Linux; well, most Debian based Linux distributions such as Debian itself, Ubuntu, Kali, Linux Mint has this error when trying to install a package/application “Package packagename 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 ‘packagename’ has no installation candidate”

Fixing error: Package packagename 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 ‘packagename’ has no installation candidate - blackMORE Ops

Package somePackage 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 somePackage has no installation candidate

Extremely annoying and useless error that doesn’t tell you much on how to fix it.

 

Fixing “Package packagename 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 ‘packagename‘ has no installation candidate” error

However, this is rather eacy to fix. Just use the following command in any Debian based Linux Operation system such as Debian itself, Ubuntu, Kali Linux, Linux Mint etc.

sudo apt-get update && && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get install packagename
(or)
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install packagename

(where packagename refers to the package that failed to install in the first place)

Once you’ve updated, upgraded, you should be able to install any packages without errors.

Download GPG Authentication Key

Assuming you already have GPG (GnuPG) installed (most Linux distro these days have GPG pre-installed), you can download a copy of your Linux distributions official key.

Kali Linux

Use the following commands: (Source: Downloading Kali Linux. Also thanks to user emra for pointing it out, Cheers)

wget -q -O - https://www.kali.org/archive-key.asc | gpg --import

or the command

gpg --keyserver hkp://keys.gnupg.net --recv-key 7D8D0BF6

Your output should look like this:

gpg: key 7D8D0BF6: public key "Kali Linux Repository <devel@kali.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

Verify that the key is properly installed with the command:

gpg --list-keys --with-fingerprint  7D8D0BF6

The output will look like this:

pub   4096R/7D8D0BF6 2012-03-05 [expires: 2015-03-05]
Key fingerprint = 44C6 513A 8E4F B3D3 0875  F758 ED44 4FF0 7D8D 0BF6
uid       [ unknown] Kali Linux Repository <devel@kali.org>
sub   4096R/FC0D0DCB 2012-03-05 [expires: 2015-03-05]

You’re now set up to validate your Kali Linux download.

Ubuntu Linux

I have since tried this in an Ubuntu installation I had (I forgot to update it for a very long time). Worked fine.

Error Samples:

W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6D975C4791E7EE5E
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A9BF3BB4E5E17B5
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FB8BEE0A1F196A8
W: Failed to fetch http://ppa.launchpad.net/chromium-da...jaunty/Release
W: Some index files failed to download, they have been ignored, or old ones used instead.

The fix for this is to re-download the keys using the hexidecimal numbers given in the error . Note that your hexadecimal numbers may be different then mine, so make sure to use the hexadecimals numbers in your error, not mine.

Type this command into the terminal:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys

And then add the hexadecimal numbers to the command (again, these are my keys from my error. Make sure to use your own):

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6D975C4791E7EE5E 5A9BF3BB4E5E17B5 7FB8BEE0A1F196A8"

The output should look like this:

gpg: requesting key 437D05B5 from hkp server keyserver.ubuntu.com"

Once GPG keys are imported, I advise to do an update, upgrade, dist upgrade and then install the package you want. Following command will do just that:

sudo apt-get update && && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get install packagename
(or)
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install packagename

After this, life should be normal again!

You may also like

17 comments

obuntu December 14, 2014 - 12:08 am

sir, how about solving this issue
……………………………………………………………………………..
dpkg: unrecoverable fatal error, aborting:
reading files list for package ‘ratproxy’: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

Reply
xfuegox January 5, 2015 - 11:17 pm

obuntu : take a look at this to resolve ur problem

Backup the dpkg status
file: cp /var/lib/dpkg/status{,.backup}

Edit the /var/lib/dpkg/status file and remove the sections for the packages that apt-get printed warnings about. Make sure that you remove the whole section about these packages,

Run sudo dpkg –configure -a to configure un-configured packages
(Re)install the packages with sudo apt-get -f install. The packages are missing because we removed them from the status file.

good luck!

Reply
jesusguevarautomotriz December 15, 2014 - 1:42 am

after follows your procedure…

# apt-get install gnome-web-photo
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package gnome-web-photo 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 ‘gnome-web-photo’ has no installation candidate

Reply
xfuegox January 5, 2015 - 11:12 pm

gnome-web-photo exist just on sid repo, u can download it manualy but u should satisfied the dependencies

https://packages.debian.org/sid/gnome-web-photo

btw blackMORE Ops u r doing a great job

best wishes

Reply
Jahaziel Jay Estabillo Villanueva February 4, 2015 - 2:39 am

Look i still have the error

http://prntscr.com/60lrtq
http://prntscr.com/60ls2q

Please help :) Thank you !

Reply
Rewanth Coo Ol March 7, 2015 - 12:18 am

W: GPG error: http://downloads.sourceforge.net all Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY CCC158AFC1289A29
W: GPG error: http://security.kali.org kali/updates Release: The following signatures were invalid: KEYEXPIRED 1425567400 KEYEXPIRED 1425567400 KEYEXPIRED 1425567400
W: Failed to fetch http://deb.playonlinux.com/dists/lenny/main/binary-i386/Packages 404 Not Found [IP: 37.187.89.171 80]

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

im getting like this after i typed the above commands . What should i do now inorder to get rid of this????

Reply
emra March 13, 2015 - 6:39 pm

tried the following solution and it worked:
# apt-key adv –keyserver hkp://keys.gnupg.net –recv-keys 7D8D0BF6

Reply
blackMORE Ops March 13, 2015 - 10:13 pm

Correct, both of these would work

$ wget -q -O - https://www.kali.org/archive-key.asc | gpg --import

or the command
$ gpg --keyserver hkp://keys.gnupg.net --recv-key 7D8D0BF6

Your output should look like this:
gpg: key 7D8D0BF6: public key "Kali Linux Repository " imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

Verify that the key is properly installed with the command:
gpg --list-keys --with-fingerprint 7D8D0BF6

The output will look like this:
pub 4096R/7D8D0BF6 2012-03-05 [expires: 2015-03-05]
Key fingerprint = 44C6 513A 8E4F B3D3 0875 F758 ED44 4FF0 7D8D 0BF6
uid [ unknown] Kali Linux Repository
sub 4096R/FC0D0DCB 2012-03-05 [expires: 2015-03-05]

Reply
prithvi May 25, 2017 - 8:16 pm

root@kali:~# apt-get install alacarte
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package alacarte 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 ‘alacarte’ has no installation candidate
root@kali:~#
these commands are not solving my problem

Reply
John Yoeser April 17, 2020 - 5:04 am

I also have same problem.can anyone please solve it

Reply
devora July 5, 2017 - 6:07 pm

I still got the error :
E: Package ‘aptitude’ has no installation candidate
any one can help ?

Reply
Krishangi Goswami April 20, 2018 - 7:50 pm

xyz@blah:~$ sudo apt-get install mailutils
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package mailutils 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 ‘mailutils’ has no installation candidate

Reply
atif May 25, 2018 - 7:13 pm

sudo apt-get install tor
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package tor 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 ‘tor’ has no installation candidate

Reply
rajul May 27, 2019 - 11:09 am

i am still getting the same error in my ubuntu 18.04 even after following your procedure

Reply
Alex from Russia April 24, 2020 - 7:54 pm

Hello, from 2020! It really help. Thanks so much!

Reply
IVD December 6, 2022 - 10:41 am

Omg this was super helpful even in 2022, thank you!

Reply
blackMORE June 19, 2024 - 2:46 am

wow, I didn’t even knew people are reading my blog. I started it off as a personal wiki. Glad to see it helped.

Reply

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.