- Ошибка при установке linux-headers
- sinner67
- BarDimNik
- zed
- How to solve Kali Linux apt-get install: E: Unable to locate package checkinstall
- 1. Edit the apt sources.list file with some editor
- 2. Append old repositories information
- 3. Check if your can install the package
- Can’t install anything on Kali Linux (Unable to locate package..) [closed]
- 3 Answers 3
- [Solved] E: Unable to locate package in Kali Linux
Ошибка при установке linux-headers
E: Unable to locate package linux-headers-4.12.0-kali1-amd64
E: Couldn’t find any package by glob ‘linux-headers-4.12.0-kali1-amd64’
E: Couldn’t find any package by regex ‘linux-headers-4.12.0-kali1-amd64’
Сам я еще совсем зеленый новичок, не бейте тапками
sinner67
apt-get update apt-get upgrade apt-get dist-upgrade
BarDimNik
apt-get install -y dkms linux-headers-$(uname -r)
Мне система выдала вот такую ошибку
E: Unable to locate package linux-headers-4.12.0-kali1-amd64
E: Couldn’t find any package by glob ‘linux-headers-4.12.0-kali1-amd64’
E: Couldn’t find any package by regex ‘linux-headers-4.12.0-kali1-amd64’
Сам я еще совсем зеленый новичок, не бейте тапками
zed
это нормально для кали
обновись полностью apt-get update && apt-get dist-upgrade
и reboot
далее смотрим версию ядра uname -r
теперь смотрим apt-cache search linux-headers и apt-cache search linux-image на доступность хеадерсов и имеджа в репах
если к примеру у тебя версия используемого ядра совпадает с тем что есть в репах
то можешь выполнять свою команду apt-get install -y dkms linux-headers-$(uname -r)
но в последнее время в кали линукс установленная версия ядра отличается от исходников что содержатся в репозиториях
поэтому идешь на оф сайт
и ищешь 2 файла под свое ядро это
linux-headers******common*****.deb
и
linux-headers*****all*****.deb
(звездочки это твоя версия ядра и разрядность ос)
скачиваешь их и ставишь со всеми необходимыми зависимости и нужными компиляторами( которые при ошибки запуска будут требоваться к установке)
сначала устанавливаешь файл common, потом all
командой dpkg -i linux-headers******common*****.deb (выходит ошибка, смотришь чего не хватает и ставишь ставишь через apt install этот пакет)
после устанавливаешь также linux-headers*****all*****.deb
перезагружаешь ос и командой apt-cache search linux-headers и apt-cache search linux-image видишь только что установленные нами исходники ядра
и вот теперь выполняешь свою команду apt-get install -y dkms linux-headers-$(uname -r)
How to solve Kali Linux apt-get install: E: Unable to locate package checkinstall
Learn how to solve the installation error of Check Install in Kali Linux.
In some of our tutorials, we like to build packages from source as this helps you to get more experience as a developer, knowing the why of the things etc. Unfortunately, some reports mentioned the exception of the failure of the installation of the checkinstall package with the following command:
sudo apt-get install checkinstall
The error triggered in the terminal (Unable to locate package), says basically that the package cannot be found in the repositories list of apt that you have currently in your Kali Linux. In this short article, we will explain you how to install the checkinstall package adding some missing entries to the sources of apt in Kali Linux.
1. Edit the apt sources.list file with some editor
As part of its operation, Apt uses a file that lists the ‘sources’ from which packages can be obtained. This file is /etc/apt/sources.list and you need to edit it with some either CLI editor o text editor, we will use the nano editor in this case:
sudo nano /etc/apt/sources.list
We will append some text at the end of this file in the next step.
2. Append old repositories information
Now that you know the file that you need to edit, proceed to append the following entries at the end of the file:
deb http://http.kali.org/kali kali-rolling main contrib non-free # For source package access, uncomment the following line # deb-src http://http.kali.org/kali kali-rolling main contrib non-free deb http://http.kali.org/kali sana main non-free contrib deb http://security.kali.org/kali-security sana/updates main contrib non-free # For source package access, uncomment the following line # 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 deb http://old.kali.org/kali moto main non-free contrib # For source package access, uncomment the following line # deb-src http://old.kali.org/kali moto main non-free contrib
This basically adds the old kali repositories to apt, so we will be able to install the checkinstall tool with the regular command. The first word on each line, deb or deb-src, indicates the type of archive. Deb indicates that the archive contains binary packages (deb), the pre-compiled packages that we normally use. Deb-src indicates source packages, which are the original program sources plus the Debian control file (.dsc) and the diff.gz containing the changes needed for packaging the program.
Save changes to the file and proceed to update the repositories list with:
3. Check if your can install the package
Finally, after saving changes and running sudo apt-get update , proceed with the installation of the checkinstall package with the following command:
sudo apt-get install checkinstall
Now you should be able to install this package without any issue.
Can’t install anything on Kali Linux (Unable to locate package..) [closed]
What package are you trying to install? Are you sure it’s in the repositories? You’ve done an apt update or apt-get update ?
You can’t just install any package in existence, only the ones in your repos are available. And what was the output from an update, did it actually update anything or gave errors? This command should list all packages, available and «[installed]»: apt search «.*»
3 Answers 3
Solved Unable to Locate Package Issue
- Enter the command: leafpad /etc/apt/sources.list
- Remove everything within that sources.list file
- Google for «Kali Linux Repository» or use this link: Kali Linux Repository
- Scroll down and look for «The kali-rolling repository»
- Copy everything within that kali-rolling and paste on sources.list file
- Save the sources.list file
- Run the command: apt-get update
- Now install ur package(e.g:apt-get install tor)
You may have an issue with your /etc/apt/sources.list file which is where the apt command looks for the installation of new packages. According to the Kali official docs:
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.
You can try making a backup of your current sources.list file then creating a new one with the «default» source entry. You’ll need to run these as root/with sudo:
# cp /etc/apt/sources.list /etc/apt/sources.list.backup
# echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list
Now try running sudo apt update . If that completes successfully, try installing your package again. See the link above for additional information that may be useful depending on your exact Kali release.
[Solved] E: Unable to locate package in Kali Linux
Like other Linux distribution Kali Linux also needs a dedicated source to download and install the packages we need. By default, Kali Linux doesn’t come with the necessary source links.
We need to manually put the list of sources from where we want to install our required packages. If there is no sources list or bad sources list on the Linux system it will result in ‘E: unable to locate package‘ error.
This problem may comes due to bad internet connection. If the internet connection is not the problem then it might because for the wrong repository. We will solve this problem by going through the processes explained in this article.
First we need to go to our Kali Linux’s computer File system and navigate to etc/apt folder.
Right-click on the ‘sources.list‘ text file and open it with any text editor.
editing sources.list on mousepad |
Delete if there is anything already wrote on the text file. Then copy and paste following lines there.
There is another way to do it more easily. We can use a single command to do all these works. We just need to open a terminal and run the following command:
echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" | sudo tee /etc/apt/sources.list
This command may ask the super user password (SuDo password) of the Kali Linux machine and fix the repository.
Now we need to update the system by using following command:
Now it will start update and after update our problem is fixed.
So this is the most simple way to fix unable to locate package in Kali Linux.
Fix slow update/upgrade or install in Kali Linux |
---|
It will work for everyone if not then please comment down below. For more tutorial on Kali Linux visit our blog regularly and follow us on Twitter an Medium for quick update.