Installing kernel headers packages missing error - linux

I am trying to install kernel-headers but getting this error
E: Unable to locate package linux-headers-5.9.0-kali1-amd64
E: Couldn't find any package by glob 'linux-headers-5.9.0-kali1-amd64'
E: Couldn't find any package by regex 'linux-headers-5.9.0-kali1-amd64'
I have updated and uncommented this line in sources.list
deb-src http://http.kali.org/kali kali-rolling main contrib non-free
but errors thats can't locate regex or glob. what I am missing?

Here's what you may need to do
sudo apt-get update # This will update the repositories list
sudo apt-get upgrade # This will update all the necessary packages on your system
sudo apt-get dist-upgrade # This will add/remove any needed packages
reboot # You may need this since sometimes after a upgrade/dist-upgrade, there are some left over entries that get fixed after a reboot
sudo apt-get install linux-headers-$(uname -r) # This should work now

from what am guessing linux-headers-5.9.0 is not available in the kali repository.
you can always use apt-cache search linux-headers to know if it available
but to update to the latest linux headers
sudo apt-get update
sudo apt-get dist-upgrade
then search for Linux-headers available using apt search Linux-headers.
so you install the latest version using
sudo apt-get install -y linux-headers-$(uname -r)

Related

python3-pip has no installation candidate

I am having an error after typing:
sudo apt-get install python3-pip
This is the error:
Package python3-pip 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 'python3-pip' has no installation candidate
What should I do?
You need to update source list first,
Try running
sudo apt-get update
sudo apt-get upgrade #Optional
sudo apt install python3-pip
hi I had same issue but I ran the following commands to fix it
sudo add-apt-repository universe
sudo apt-get update
sudo apt install python3-pip
and it solved the problem
The solution is to add the universe repository:
sudo add-apt-repository universe
Then update apt:
sudo apt update
And try again:
sudo apt install python3-pip
in Debian 11, part of this answer helped me (I invite you to upvote it unix.stackexchange.com, please): https://unix.stackexchange.com/questions/522758/how-to-install-software-properties-common-in-debian-9/522770#522770
Summarizing, add to /etc/apt/sources.list the next line (replacing by the right Debian version name, as stretch or bullseye):
deb http://deb.debian.org/debian/ <version-name> main
In my case,
deb http://deb.debian.org/debian/ bullseye main
After this, I cold install my missing packages, as software-properties-common python3-pip vim tree

"apt-get install linux-headers-generic" installed in directory different than $(uname-r)

I am a newbie on Linux kernel. I was trying to install Linux header on ubuntu. I first tried
sudo apt-get install linux-headers-$(uname -r)
However, since the output of $(uname -r) is 4.4.0-18362-Microsoft, the installation gives me the error:
E: Unable to locate package linux-headers-4.4.0-18362-Microsoft
E: Couldn't find any package by glob 'linux-headers-4.4.0-18362-Microsoft'
E: Couldn't find any package by regex 'linux-headers-4.4.0-18362-Microsoft'
By searching on the internet, I found that linux headers do not exist on WSL. Therefore I tried something that is recommended on the internet, by doing
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install linux-generic
sudo apt-get install linux-headers-generic
Then I got a successful installation under /usr/src/linux-headers-4.15.0-51-generic and /usr/src/linux-headers-4.15.0-51. However, my team uses a makefile where the directory of the Linux headers is referred to using $(uname -r), which is still 4.4.0-18362-Microsoft. So whenever I do make, it still gives me the error
can't read /usr/src/linux-headers-4.4.0-18362-Microsoft/...
Is there anyway I can install the headers or change $(uname -r) such that I can use $(uname -r) to refer to the directory?
Create a symlink from /usr/src/linux-headers-4.15.0-51-generic to /usr/src/linux-headers-4.4.0-18362-Microsoft/
sudo ln -s /usr/src/linux-headers-4.15.0-51-generic /usr/src/linux-headers-4.4.0-18362-Microsoft
I'm using Ubuntu 18.04.2 LTS and had a similar issue - but it wasn't Microsoft:
E: Unable to locate package linux-headers-4.15.0-51-generic-generic
E: Couldn't find any package by glob 'linux-headers-4.15.0-51-generic-generic'
E: Couldn't find any package by regex 'linux-headers-4.15.0-51-generic-generic'
For me worked fine after I did as below:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-generic
sudo apt-get install linux-headers-$(uname -r)

How to install libjpeg62-dev on Raspberry Pi?

I am following the tutorial https://pimylifeup.com/raspberry-pi-webcam-server/ to build a web server for raspberry pi camera stream.
I had the problem: ./motion: error while loading shared libraries: libavformat.so.53: cannot open shared object file: No such file or directory
And after I search for many solutions, one said to install:
sudo apt-get install -y libjpeg62 libjpeg62-dev libavformat53 libavformat-dev libavcodec53 libavcodec-dev libavutil51 libavutl-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev
But I got these error:
E: Package 'libjpeg62-dev' has no installation candidate
E: Unable to locate package libavformat53
E: Unable to locate package libavcodec53
E: Unable to locate package libavutil51
I search for long time but don't find solution to install libjepg62-dev.
The reason for this is, these packages have been removed in the latest jessie release. I've figured a way to fix this.
Try the following:
Note: Never pass the -y argument to apt-get install when doing any of the following. It might remove existing packages. So, always confirm the installation manually for every single package you need.
Add the line deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi to the file /etc/apt/sources.list at the top.
Do sudo apt-get update.
Install the library: sudo apt-get install libavformat53
Install other libs too like libpq5.
Remember to undo the change you did in step 1. i.e., remove the line and perform sudo apt-get update

Install linux-headers on debian unable to locate package

I am trying to install the linux-headers for my Kernel Version 3.4.61+ and Debian Version 7.1
I typed this Commands:
apt-get update
apt-get install linux-headers-$(uname -r)
On the last command I always get an Error:
E: Unable to locate package linux-headers-3.4.61
E: Couldn't find any package by regex 'linux-headers-3.4.61'
btw: It´s all based on a Cubietruck/Cubieboard3
Here's what you may need to do
sudo apt-get update # This will update the repositories list
sudo apt-get upgrade # This will update all the necessary packages on your system
sudo apt-get dist-upgrade # This will add/remove any needed packages
reboot # You may need this since sometimes after a upgrade/dist-upgrade, there are some left over entries that get fixed after a reboot
sudo apt-get install linux-headers-$(uname -r) # This should work now
You could search first, then choose the closest one.
For example, on my system:
$ apt-cache search linux-headers
linux-headers-3.2.0-4-all - All header files for Linux 3.2 (meta-package)
linux-headers-3.2.0-4-all-amd64 - All header files for Linux 3.2 (meta-package)
linux-headers-3.2.0-4-amd64 - Header files for Linux 3.2.0-4-amd64
So I can install any one of these three.
Heres my experience with this problem:
I installed Kali Linux from a live memory stick. Whilst installing I didn't have an internet connection.
This meant that my sources.list file was set to "Default Off-line Install Values". This meant that when installing I was limited to just the packages and data from the memory stick I Initially installed from.
To fix this, you need to change your sources.list (called switching branches):
Open terminal:
nano /etc/apt/sources.list
This opens the sources file
Now at the top of the file paste in the following two lines:
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
Press CTRL + X then Press Y and Enter to save the file.
Now you can type the following commands to update Kali:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
reboot
And finally, you should now be able to...
sudo apt-get install linux-headers-$(uname -r)
This is just my unique experience with this error stemming from an offline install.
I hope this helps someone else out there.
Reference
Check the Source.list file to contain the repository entries.
You can find them at - https://docs.kali.org/general-use/kali-linux-sources-list-repositories.
After editing the file, save it and run "apt-get update && apt-get upgrade". Now run "apt-get install linux-headers-$(uname -r)"
For latest version of kali linux do the following to install vbox guest additions.
Update the packages
# apt-get update
Command to install virtualbox guest additions
# apt-get install -y virtualbox-guest-x11
Reboot
# reboot
Enjoy!
Now you have successfully installed guest OS additions and you can verify that by toggling full-screen it should now stretch to your screen resolution.
Source: Kali Linux Official (Docs - VirtualBox guest additions)
Just Use:
sudo apt-get install linux-headers-generic
if you are on a Desktop installation. The apt-get will solve the dependencies and install the correct version of kernel headers.

Using 'sudo apt-get install build-essentials'

I was trying to use sudo apt-get install build-essentials to install the g++ compiler on my Ubuntu Linux box. But it gave me the following message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package build-essentials
How do I fix this problem?
Drop the 's' off of the package name.
You want sudo apt-get install build-essential
You may also need to run sudo apt-get update to make sure that your package index is up to date.
For anyone wondering why this package may be needed as part of another install, it contains the essential tools for building most other packages from source (C/C++ compiler, libc, and make).
In my case, simply "dropping the s" was not the problem (although it is of course a step in the right direction to use the correct package name).
I had to first update the package manager indexes like this:
sudo apt-get update
Then after that the installation worked fine:
sudo apt-get install build-essential
Try
sudo apt-get update
sudo apt-get install build-essential
(If I recall correctly the package name is without the extra s at the end).
I know this has been answered, but I had the same question and this is what I needed to do to resolve it. During installation, I had not added a network mirror, so I had to add information about where a repo was on the internet. To do this, I ran:
sudo vi /etc/apt/sources.list
and added the following lines:
deb http://ftp.debian.org/debian wheezy main
deb-src http://ftp.debian.org/debian wheezy main
If you need to do this, you may need to replace "wheezy" with the version of debian you're running. Afterwards, run:
sudo apt-get update
sudo apt-get install build-essential
Hopefully this will help someone who had the same problem that I did.
The package is called build-essential without the plural "s". So
sudo apt-get install build-essential
should do what you want.
Try 'build-essential' instead.
To auto-generate the "source.list" file I suggest to use:
https://debgen.simplylinux.ch/
Where you can select the country, the distribution, ..etc
After that, all you need to do is to replace (take a backup of the file first) your original source.list file with the generated one and do as mentioned in other answers:
sudo apt-get update
sudo apt-get install build-essential
Manifest for installing rust and build-essentials on ubuntu 20.04.03
rustup self uninstall
apt-get update
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe"
apt-get -u dist-upgrade
apt install aptitude
sudo aptitude install libc6=2.31-0ubuntu9
sudo aptitude install build-essential
apt-get update
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
rustup toolchain install nightly --allow-downgrade --profile minimal --component clippy
rustup default stable
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev
rustc --version
source $HOME/.cargo/env
#No tested on me Fast Installation: Install all the required dependencies with a single command. (Be patient, this can take up to
30 minutes)
curl https://getsubstrate.io -sSf | bash -s -- --fast
Finally step test:
https://doc.rust-lang.org/cargo/getting-started/first-steps.html
#ArmanRiazi.Blockchain#Substrate#Dr.GavinWood

Resources