{"id":24214,"date":"2024-01-31T14:05:14","date_gmt":"2024-01-31T14:05:14","guid":{"rendered":"https:\/\/linuxways.net\/?p=24214"},"modified":"2024-01-31T14:05:14","modified_gmt":"2024-01-31T14:05:14","slug":"fix-unable-locate-package-kali-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/kali-linux\/fix-unable-locate-package-kali-linux\/","title":{"rendered":"How to Fix Unable to Locate Package on Kali Linux"},"content":{"rendered":"<p>Installing packages on a Linux system, including Kali Linux, is a common and widely used task. The reason is, most packages are available in the official system repository and can be installed through the apt install command. However, sometimes you may encounter <strong>unable to locate package<\/strong> error on your system that prevents you from installing the application through apt repository. There are a number of reasons for the occurrence of <strong>unable to locate package error <\/strong>on Kali Linux.<\/p>\n<p>In this guide, you will learn:<\/p>\n<ul>\n<li><a href=\"#post-24214-_jah4ng3g8o6\"><strong>Why Unable to Locate Package Error Occurs on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24214-_rgjznbmsed7\"><strong>How to Fix Unable to Locate Package Error on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24214-_e6rrrputlf97\"><strong>Bonus Method: How to Fix \u201csudo: add-apt-repository command not found\u201d on Kali Linux <\/strong><\/a><\/li>\n<li><a href=\"#post-24214-_jua99wl420fj\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-24214-_jah4ng3g8o6\"><\/a><strong>Why Unable to Locate Package Error Occurs on Kali Linux<\/strong><\/h2>\n<p>While installing a package on your <strong>Kali Linux<\/strong> system, you may encounter <strong>unable to locate package<\/strong> error, as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"200\" class=\"wp-image-24286\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-1.png 665w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-1-300x90.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/p>\n<p>The <strong>unable to locate package<\/strong> error occurs in a system because the package you want to install is not available in the source repository. This might be due to the repository you added doesn\u2019t include the package you want to install. Though, most of the packages are available in the<strong> Kali Linux<\/strong> official repository, so this error might occur due to some issue in the official system repository.<\/p>\n<h2><a id=\"post-24214-_rgjznbmsed7\"><\/a><strong>How to Fix Unable to Locate Package Error on Kali Linux<\/strong><\/h2>\n<p>To fix<strong> unable to locate package<\/strong> error on <strong>Kali Linux<\/strong>, you can use the following steps:<\/p>\n<p><strong>Step 1: Create a Backup File on Kali Linux<\/strong><\/p>\n<p>First, it is recommended to create a backup of your <strong>sources.list<\/strong> file where all repositories are saved. Doing this will ensure recovering your file in case you have edited the file in a wrong way. You can create a backup of <strong>sources.lis<\/strong>t file on <strong>Kali Linux <\/strong>by using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">cp<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.backup<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"124\" class=\"wp-image-24288\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-2.png 669w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-2-300x56.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\n<p><strong>Step 2: Remove Everything from sources.list File<\/strong><\/p>\n<p>Now, open the repository source file <strong>sources.list <\/strong>on <strong>Kali Linux<\/strong> and removes everything inside the file using <strong>CTRL+K<\/strong>. You can open the Kali Linux repository file by using the nano editor from the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">nano<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list<\/div><\/div>\n<p><strong>Step 3: Add Repository to Kali Linux <\/strong><\/p>\n<p>Now, head towards the <a href=\"https:\/\/www.kali.org\/docs\/general-use\/kali-linux-sources-list-repositories\/\"><strong>Kali Linux<\/strong> <strong>network repositories web page<\/strong> <\/a>and add the<strong> kali-rolling<\/strong> repository to <strong>sources.list<\/strong> file starting from deb:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">deb http:<span class=\"sy0\">\/\/<\/span>http.kali.org<span class=\"sy0\">\/<\/span>kali kali-rolling main contrib non-free non-free-firmware<span class=\"st0\">&quot; | sudo tee \/etc\/apt\/sources.list<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"458\" class=\"wp-image-24290\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-3.png 657w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-3-300x209.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Once the repository is added, you can save the file using <strong>CTRL+X<\/strong>, then add <strong>Y<\/strong> to approve the changes in the file and pressing the <strong>Enter <\/strong>button to close the file<strong>.<\/strong><\/p>\n<p>Alternatively, the following command can also be used to add the repository to <strong>Kali Linux<\/strong> system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb http:\/\/http.kali.org\/kali kali-rolling main contrib non-free non-free-firmware&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"117\" class=\"wp-image-24299\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-4.png 675w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-4-300x52.png 300w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><\/p>\n<p><strong>Step 4: Update Kali Linux Repository<\/strong><\/p>\n<p>Once you added the repository, update your<strong> Kali Linux<\/strong> system using the below-given command to ensure the changes are successfully applied:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"662\" height=\"350\" class=\"wp-image-24310\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-5.png 662w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-5-300x159.png 300w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/p>\n<p><strong>Step 5: Install the Package on Kali Linux<\/strong><\/p>\n<p>After updating the repository without any warning or error, you can reinstall that application from the apt install command. Here, I have installed <strong>VLC media player<\/strong> from the official <strong>Kali Linux<\/strong> repository, which was causing error in the previous run:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> vlc <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"193\" class=\"wp-image-24316\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-6.png 659w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-6-300x88.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/p>\n<p><strong>Note: <\/strong>If you are still encountering <strong>unable to locate package<\/strong> error on <strong>Kali Linux<\/strong>, then you should add the package repository to the system. The reason is that the package won\u2019t be there in the system repositories currently added to your system. You can find the repository with a GPG key to install a specific package on the official website of that package. Just add a repository and GPG key, then update the repository and install that application through the <strong>apt install<\/strong> command with the package name.<\/p>\n<h2><a id=\"post-24214-_e6rrrputlf97\"><\/a><strong>Bonus Method: How to Fix \u201csudo: add-apt-repository command not found\u201d on Kali Linux <\/strong><\/h2>\n<p>Sometimes, the repositories for installing a package are added to the Kali Linux system with the <strong>add-apt-repository<\/strong> command. However, this command will not work by default on some Linux systems, including <strong>Kali Linux <\/strong>because of dependencies conflict or compatibility issues. When you try to add a repository to Kali Linux with the <strong>add-apt-repository <\/strong>command, you will get the following error:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"62\" class=\"wp-image-24324\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-7.png 666w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-7-300x28.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/p>\n<p>You can fix this error on Kali Linux and other Linux distribution by installing the following dependencies on Kali Linux:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> software-properties-common python3-launchpadlib <span class=\"re5\">-y<\/span><\/div><\/div>\n<p>After that, you can use the <strong>add-apt-repository<\/strong> command to add any repository, install packages from that repository and fix<strong> unable to locate package<\/strong> error on<strong> Kali Linux<\/strong>.<\/p>\n<p>As an example, I have added the following repository to <strong>Kali Linux<\/strong> system for installing <strong>ffmpeg<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> add-apt-repository ppa:jonathonf<span class=\"sy0\">\/<\/span>ffmpeg-<span class=\"nu0\">4<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"321\" class=\"wp-image-24343\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-9.png 668w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-9-300x144.png 300w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/p>\n<p><strong>Note: <\/strong>You may find<strong> ffmpeg<\/strong> in the official <strong>Kali Linux<\/strong> repository, however, the example provided is just to guide you how you can fix the <strong>add-apt-repository<\/strong> <strong>command not found<\/strong> error.<\/p>\n<p>By default, <strong>apt-apt-repository<\/strong> updates the repository list, however, to ensure the repository is updated, you may run the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p>Then install the application using the <strong>apt install <\/strong>command on Kali Linux system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> <span class=\"kw2\">ffmpeg<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"188\" class=\"wp-image-24353\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-10.png 665w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24214-10-300x85.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/p>\n<p><strong>Note: <\/strong>If you are still encountering <strong>unable to locate package<\/strong> error on Kali Linux, then you can install and use independent package managers like <a href=\"https:\/\/linuxways.net\/de\/debian\/install-use-flatpak-debian-12\/\"><strong>Flatpak<\/strong><\/a> and <a href=\"https:\/\/linuxways.net\/de\/debian\/install-snap-on-debian-12\/\"><strong>Snap<\/strong><\/a>. These package managers include several packages that you may not find in the official Kali Linux repository. Most likely, you will find and install your required packages with these package managers on your Kali Linux system.<\/p>\n<p>Further, some packages also have a deb file that you can download on your system and install the package from the <strong>apt install <\/strong>command using the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> .<span class=\"sy0\">\/<\/span>file_name.deb<\/div><\/div>\n<h2><a id=\"post-24214-_jua99wl420fj\"><\/a><strong>Conclusion<\/strong><\/h2>\n<p><strong>Unable to locate package <\/strong>is a common error in Linux systems including <strong>Kali Linux <\/strong>that occurs if there is a problem in the repository or the package is not available. You can fix the error related to your package by removing the repository and adding one again if there is an issue with the repository. If the package is not available, you can also add another repository using the same step-by-step guidelines for adding the repository in the above-section of this guide. Further, you can also fix the <strong>add-apt-repository<\/strong> command not found error by installing dependencies on your system. Once done, you can utilize the <strong>add-apt-repository <\/strong>command to add an external repository and install the package to fix the error.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can fix unable to locate package error on Kali Linux by removing the repository and adding one again, or add an external repository of the package.<\/p>","protected":false},"author":116,"featured_media":24464,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1054],"tags":[],"class_list":["post-24214","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kali-linux"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=24214"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24214\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/24464"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}