Home How to How to add official Kali Linux Repositories?

How to add official Kali Linux Repositories?

by blackMORE

This is a small guide on how to add official Kali Linux Repositories – I’ve updated it to include all versions of Kali Linux till date i.e. Kali 1.x, Kali 2.0/Kali Sana and Kali Rolling. How to add official Kali Linux Repositories – Kali Linux 2.x Sana repositories - blackMORE-Ops

The single most common causes of a broken Kali Linux installation are following unofficial advice, and particularly arbitrarily populating the system’s sources.list file with unofficial repositories. The following post aims to clarify what repositories should exist in sources.list, and when they should be used.

Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL.

Edit your sources.list

The easiest way is to edit the /etc/apt/sources.list

root@kali:~# vi /etc/apt/sources.list
(or)
root@kali:~# leafpad /etc/apt/sources.list

Add official repo’s only:

Copy paste the following repositories (remove existing lines or you can comment them out – your take). Following repo list was taken from official Kali sources.list Repositories page:

The Kali Rolling Repository

Kali-Rolling is the current active repository since the release of Kali 2016.1 and 2016.2. Kali Rolling users are expected to have the following entries in their sources.list:

deb http://http.kali.org/kali kali-rolling main contrib non-free
deb-src http://http.kali.org/kali kali-rolling main contrib non-free

Save and close the file.

Retired Kali Sana (Kali 2.0) Repositories

For access to the retired Kali Sana or Kali 2.0 repositories, have the following entries in your sources.list:

deb http://old.kali.org/kali sana main non-free contrib
deb-src http://old.kali.org/kali sana main non-free contrib

Save and close the file.

Retired Kali moto (1.0) Repositories

For access to the retired moto repositories, have the following entries in your sources.list:

deb http://old.kali.org/kali moto main non-free contrib
deb-src http://old.kali.org/kali moto main non-free contrib

Save and close the file.

OLD Instructions (Kali 1.0 – does not work anymore)

I’ve kept these for historical purpose only, these repo’s worked on Kali 1.x (2013 – 2015). Do no follow these anymore.

# Regular repositories
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana/updates main contrib non-free
# Source repositories
deb-src http://http.kali.org/kali sana main non-free contrib
deb-src http://security.kali.org/kali-security sana/updates main contrib non-free

Clean your apt-get

apt-get clean

Do an apt-get update

apt-get update

Do an upgrade

apt-get upgrade

Finally do a distribution upgrade

apt-get dist-upgrade

That’s it, you’re set.

Conclusion

Despite what many unofficial guides instruct you to do, avoid adding extra repositories to your sources.list files. Don’t add kali-dev, kali-rolling or any other Kali repositories unless you have a specific reason to – which usually, you won’t. If you must add additional repositories, drop a new sources file in /etc/apt/sources.list.d/ instead. [Source: Offensive Security Blog]

If you must, (despite warning many users will be tempted), do try it in a VirtualBox/VMWare first and take snapshots so that you can roll back. Kali updates are quite big and takes a lot of time to download and their DVD ISO’s are not very up to date. You can build your own custom updated ISO by following these instructions and keep using that offline.

Thanks for reading. If I have made a mistake, please correct me.

You may also like

42 comments

karthik iyer August 14, 2015 - 1:51 am

Apt-get update is giving 404 not found error

Reply
Robert Beltran August 14, 2015 - 4:15 am

Many of those. I’m guessing it’s just down for the day?

Reply
ZeroCoolNemesis January 17, 2016 - 7:25 am

if you have 404 error like me, it means mostly that you are using the old repositories. to fix this:
1/you need to comment the old repositories using # at the first of their lines; so that apt-get uses only the new repositories not the old ones.
2/do the tutorial steps, it should work for you.

Reply
lukie#4 January 28, 2017 - 10:20 pm

why making it a s a comment?…why dont just delete that repository?

Reply
Pinglord August 14, 2015 - 5:49 am

Have any idea how to solve the :

Failed to fetch http://security.kali.org/kali-security/dists/sana/updates/main/binary-amd64/Packages Cannot initiate the connection to mirrors.netix.net

It seems it connects to an ipv6 address even if i disabled the ipv6 in sysctl and what is stranger is that i have inet6 address on my interface.

Reply
babaji August 17, 2015 - 9:18 pm

i forgot to do the apt-get clean
will i face any problem ?

Reply
Aung Khant August 18, 2015 - 11:12 am

I get an error when i upgrade kali 1.1.0 from 2.0.
Please give me and Advice…Thanks…../

The following packages will be upgraded:
kali-menu
1 upgraded, 0 newly installed, 0 to remove and 1372 not upgraded.
424 not fully installed or removed.
Need to get 4,016 kB of archives.
After this operation, 4,820 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://http.kali.org/kali/ sana/main kali-menu all 2.3 [4,016 kB]
Fetched 4,016 kB in 4min 29s (14.9 kB/s)
Reading changelogs… Done
(Reading database … 325998 files and directories currently installed.)
Preparing to replace kali-menu 1.371.1 (using …/archives/kali-menu_2.3_all.deb) …
Unpacking replacement kali-menu …
dpkg: error processing /var/cache/apt/archives/kali-menu_2.3_all.deb (–unpack):
trying to overwrite ‘/usr/share/icons/hicolor/48×48/apps/wireshark.png’, which is also in package wireshark 1.10.2-1~bpo70+1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/kali-menu_2.3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@blackHat:~#

Reply
eagle95 August 18, 2015 - 11:14 pm

I got the same error.. Try this..
go to console CTRL+ALT+F2 .. run apt-get clean apt-get upgrade with root privileges ..
Come back to gnome and run apt-get dist-upgrade with sudo ..

Hopefully the error goes away
verify with lsb_release -a.. should show Kali 2 sana

Reply
rahul August 20, 2015 - 3:36 am

hey how to go to console and then to gnome

Reply
rahul August 20, 2015 - 3:44 am

i m also getting this error:

I get an error when i upgrade kali 1.1.0 from 2.0.
Please give me and Advice…Thanks…../

The following packages will be upgraded:
kali-menu
1 upgraded, 0 newly installed, 0 to remove and 1372 not upgraded.
424 not fully installed or removed.
Need to get 4,016 kB of archives.
After this operation, 4,820 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://http.kali.org/kali/ sana/main kali-menu all 2.3 [4,016 kB]
Fetched 4,016 kB in 4min 29s (14.9 kB/s)
Reading changelogs… Done
(Reading database … 325998 files and directories currently installed.)
Preparing to replace kali-menu 1.371.1 (using …/archives/kali-menu_2.3_all.deb) …
Unpacking replacement kali-menu …
dpkg: error processing /var/cache/apt/archives/kali-menu_2.3_all.deb (–unpack):
trying to overwrite ‘/usr/share/icons/hicolor/48×48/apps/wireshark.png’, which is also in package wireshark 1.10.2-1~bpo70+1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/kali-menu_2.3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@blackHat:~#

Reply
rahul August 20, 2015 - 10:33 am

i am not able to remove the error after going through
the given method

Reply
Lester Obbayi August 22, 2015 - 8:16 pm

I had the same problem, here is how i solved it ->

apt-get install synaptic
in your terminal, launch synaptic by typing “synaptic” and pressing “Enter”
in synaptic, go to “missing recommended packages” tab, it will throw an error that “the following packages need to be removed, mark them for removal before proceeding?”, you need to mark them for removal and from the “package” tab apply the marked changes. It will remove the obsolete packages (metasploit, wireshark, kali-menu) and install the upgrades of these tools.
relax :D

l3s7r0z

Reply
Spike August 25, 2015 - 1:59 pm

I couldnt find the missing recommended packages tab.where is it located?

Reply
kashif Zeb September 20, 2015 - 12:07 am

W: GPG error: http://repo.kali.org kali-bleeding-edge Release: The following signatures were invalid: KEYEXPIRED 1425567400 KEYEXPIRED 1425567400 KEYEXPIRED 1425567400
W: There is no public key available for the following key IDs:
7638D0442B90D010
W: GPG error: http://security.kali.org sana/updates Release: The following signatures were invalid: KEYEXPIRED 1425567400 KEYEXPIRED 1425567400 KEYEXPIRED 1425567400
W: GPG error: http://http.kali.org sana Release: The following signatures were invalid: KEYEXPIRED 1425567400 KEYEXPIRED 1425567400 KEYEXPIRED 1425567400
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://repo.kali.org/kali/dists/kali-bleeding-edge/maindeb/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://repo.kali.org/kali/dists/kali-bleeding-edge/http://ftp.fr.debian.org/debian/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://repo.kali.org/kali/dists/kali-bleeding-edge/wheezy/binary-amd64/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
friends I have following erorrs can Any one tell me way to solve

Reply
Ose September 21, 2015 - 10:59 am

1922 upgraded, 823 newly installed, 65 to remove and 1 not upgraded.
Need to get 2,537 MB of archives.
After this operation, 1,735 MB of additional disk space will be used.
E: You don’t have enough free space in /var/cache/apt/archives/.

Reply
Jajahhh September 26, 2015 - 11:38 pm

Everything works fine no errors whatsoever great job blackmoreops

Reply
Salaheddine Elmekkaoui October 17, 2015 - 11:01 pm

everything is cool man thank you

Reply
Abubakr October 18, 2015 - 1:48 pm

Cannot install Many softwares on kali linux like google chrome etc.

Reply
jack December 15, 2015 - 12:34 am

for that case try to use mozilla firefox insted d of iceweasel http://www.blackmoreops.com/2013/10/28/how-to-install-firefox-in-kali-linux/ use this link.

Reply
punk167@gmail.com June 10, 2017 - 2:37 pm

is it cause it does not like to be ran in root? adding –no-sandbox to google-chrome-stable file will make it run. Just not safely.

Reply
Matt October 31, 2015 - 1:46 am

Guys,

@Abubakr – Kali is not designed to be your every day OS – It’s meant for penetration testing, vulnerability assessments etc. Also, unless Google Chrome came out with a .deb package (which they hadn’t up until a few months ago) The only option is Chromium, which has many dependencies. If your not adept using and troubleshooting linux issues I suggest you use Iceweasel (which is a forked FireFox)

@kashif Zeb – Your keyring has expired for those repos. Try running these commands (make sure you are root)
rm -rf /var/lib/apt/lists
apt-get update
apt-get install kali-archive-keyring

Then run a apt-get clean. Then you should be good to update your repo and OS.

Reply
Talktalk December 17, 2015 - 6:30 am

guys i am tryig to install Metasploit on Kali 2.0. can some one guide me .

Reply
Talktalk December 17, 2015 - 6:33 am

I read software-center is not supported in Kali2.0 is they anyother smilar too to insatall pakages ?

Reply
Rye December 17, 2015 - 9:30 pm

hey guys dont know what im doing wrong but my sources.list is exactly what it says and did the upgrading……so i reboot and at the login screen im able to select “Mate” and so i login as root user and it brings me to the same Gnome desktop??????after the updating i used
apt-get install mate-core mate-desktop-environment-extra mate-desktop-environment-extras……plz help thanx…cheers!

Reply
Bao January 13, 2016 - 4:55 pm

Sorry, new to Linux, so to open the tools Kali Linux apt has installed, do i still use kalitoolin? or what command do I call or is it within the linux mint commands already?

Reply
Amber January 29, 2016 - 12:24 pm

Thanks for the offical repos list. It really helped me to install updates on my Kali Linux.

Reply
unknown February 7, 2016 - 11:31 am

Thanks you saved my ass

Reply
nobm February 19, 2016 - 2:47 pm

excelent. thanks dude

Reply
DipW1nk March 6, 2016 - 8:43 pm

Thanks for your work and advice :)

Reply
razubhuiyan March 9, 2016 - 5:40 am

how can i fix this …. please help me

W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry ‘main/binary-i386/Packages’ in Release file (Wrong sources.list entry or malformed file)

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

Reply
Ionut July 17, 2016 - 8:36 pm

razubhuiyan, try to find the tutorial how to replace the sources.list

Reply
fixduino May 18, 2016 - 12:57 pm

thanks alot for tutorial, it is workr for me in kali rolling 2016.

Reply
Anonymous September 23, 2016 - 12:19 pm

Thank you for your tutorial, it works for me!

Reply
pangie October 5, 2016 - 12:58 am

i typed apt-get upgrade
pressed y to continue but then it says “could not resolve http:kali.org
help please

Reply
Ravi October 16, 2016 - 12:24 pm

One thing I want to say just one thing GREATTTTTTT. I tried many websites andblog but only this works for me .great job brother

Reply
kali linux toturail December 11, 2017 - 8:23 pm

how they do it

Reply
kali linux toturail December 11, 2017 - 10:11 pm

its is workable

Reply
Sandip February 12, 2018 - 4:32 pm

Please update the article.

Reply
zack June 22, 2018 - 11:53 pm

alert(“alert”)

Reply
dd vfgf April 6, 2019 - 5:27 am

issue in upgrade kali 2018 ……showing entries were disabled at end of installation

Reply
asasa November 29, 2019 - 6:43 am

oi good

Reply

Leave your solution or comment to help others.

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