How to install raspberry pi kernel headers of which version matches with $(uname -r) version - raspberry-pi

Title
I want to install raspberry pi kernel headers of which version matches with $(uname -r) version because I'll develop kernel modules on Raspberry Pi.
Description
I tried to execute sudo apt install raspberrypi-kernel-headers, but the header version doesn't match with the one of $(uname -r). In addition to do this, I tried to do bellow trials but the header version doesn't match with the one of $(uname -r).
Is there are ways how to install raspberry pi kernel headers of which version matches with $(uname -r) version ?
What I try to do :
1. Simply Tring to execute sudo apt install raspberrypi-kernel-headers
Reference : https://www.raspberrypi.com/documentation/computers/linux_kernel.html#kernel-headers
uname -r # Check the current ver
> 5.15.76-v7+
ls /usr/src/
> sense-hat
sudo apt install raspberrypi-kernel-headers
ls -1 /usr/src/
> linux-headers-5.15.84+
> linux-headers-5.15.84-v7+
> linux-headers-5.15.84-v7l+
> sense-hat
There is installed linux-headers-5.15.84-v7+ but is doesn't match with the $(uname -r) version.
2. Do rpi-update to update the kernel to the lastest, then execute sudo apt install raspberrypi-kernel-headers
sudo rpi-update
sudo reboot
uname -r
> 5.15.89-v7+ # update to the lastest ver !
sudo apt update
sudo apt dist-upgrade -y
sudo apt autoremove -y
sudo apt autoclean
sudo reboot
sudo apt install raspberrypi-kernel-headers
> Reading package lists... Done
> Building dependency tree... Done
> Reading state information... Done
> raspberrypi-kernel-headers is already the newest version (1:1.20230106-1).
> 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ls -1 /usr/src/
> linux-headers-5.15.84+
> linux-headers-5.15.84-v7+
> linux-headers-5.15.84-v7l+
> sense-hat
The kernel is updated to 5.15.89-v7+ but kernel header does not update, still 5.15.84-v7+.
3. --reinstall raspberrypi-kernel then install raspberrypi-kernel-headers
Reference : https://raspberrypi.stackexchange.com/questions/63879/installed-kernel-headers-and-uname-r-differ
sudo apt-get update
sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
sudo reboot
uname -r
> 5.15.89-v7+
sudo apt-get install raspberrypi-kernel-headers
ls -1 /usr/src/
> linux-headers-5.15.84+
> linux-headers-5.15.84-v7+
> linux-headers-5.15.84-v7l+
> sense-hat
The kernel is not updated, and kernel headers is too.
Appendix
1. /lib/modules
After above procedure, there are the kernel modules of which version is the same as $(uname -r) version.
ls /lib/modules
5.15.84+ 5.15.84-v7+ 5.15.84-v7l+ 5.15.84-v8+ 5.15.89+ 5.15.89-v7+ 5.15.89-v7l+ 5.15.89-v8+
2. apt install linux-headers-$(uname -r)
As like ubuntu or debian, I tried to apt install linux-headers-$(uname -r), but It was an invalid command.
apt search linux-headers-$(uname -r)
> Sorting... Done
> Full Text Search... Done
sudo apt-get install linux-headers-$(uname -r)
> Reading package lists... Done
> Building dependency tree... Done
> Reading state information... Done
> E: Unable to locate package linux-headers-5.15.84-v7
> E: Couldn't find any package by glob 'linux-headers-5.15.84-v7'
> E: Couldn't find any package by regex 'linux-headers-5.15.84-v7'

Related

postgresql-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed

I want to try new PostgreSQL and follow this instruction. But installation fails:
$ sudo apt install postgresql-client-13
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
postgresql-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried this instruction to resolve unmet dependencies
What did I wrong and how to install psql 13?
UPD
Content of my sources.list.d:
kes#kes-X751SA /etc/apt/sources.list.d $ cat pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
kes#kes-X751SA /etc/apt/sources.list.d $ cat pgdg-testing.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg-testing main 13
Also:
$ sudo apt-cache policy postgresql-13
postgresql-13:
Installed: (none)
Candidate: 13~beta2-1.pgdg18.04+1
Version table:
13~beta2-1.pgdg18.04+1 100
100 http://apt.postgresql.org/pub/repos/apt bionic-pgdg-testing/13 amd64 Packages
Had the same problem.
in /etc/apt/sources.list.d/pgdg.list where you have
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
change it to
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main 13
then run
sudo apt update
and then you can do
sudo apt install postgresql-13 postgresql-client-13
that worked on my machine.
Just FYI:
WARNING: The data format may change between beta releases. Be prepared
to pg_dump the database contents before you upgrade the package to a
newer beta or to a final release. Check the release notes before
upgrading.
try aptitude instead of apt-get
sudo apt-get install aptitude
sudo aptitude install <package-name>
https://askubuntu.com/a/1056378/1087086
Finally at my docker container I do next commands:
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install llvm5.0-devel
RUN yum -y install centos-release-scl-rh
RUN yum -y install llvm-toolset-7-clang
#RUN rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm --replacepkgs
#RUN yum-config-manager --enable pgdg13-updates-testing
RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum -y install postgresql13 postgresql13-devel
Commented out lines were for case before 13.1 was released

How to upgrade Visual Studio Code editor?

What's the best way to upgrade Visual Studio Code on Linux Ubuntu?
For the time being I was periodically getting the newest version (.deb) from their official site: https://code.visualstudio.com/
sudo dpkg -i code_*.deb
Visual Studio Code enabled official Linux repositories on February 2017 (v1.10)
sudo add-apt-repository -y "deb https://packages.microsoft.com/repos/vscode stable main "
sudo apt update
sudo apt -y install code
You can upgrade / dist-upgrade as usual
sudo apt -y upgrade
sudo apt -y dist-upgrade
[1]: download the latest vscode (.deb) package to your computer on this
link :
https://go.microsoft.com/fwlink/?LinkID=760868
, or this there :
https://code.visualstudio.com/docs/
[2]: then open a terminal in the folder where you downloaded the .deb file and write:
sudo dpkg -i <the downloaded file>.deb
[3]: finally if you have apt-get do (if not install apt-get first):
sudo apt-get install -f
If you have installed it via the repository, exit VS Code then just do:
sudo apt update
sudo apt install code
This is the same command to install or upgrade to the latest version. You can see the version with:
code --version
Now the easiest and recommended way is to use snap:
sudo snap install --classic code
And updates are supposed to be automatic.
This works fine in ubuntu.
sudo apt-get update
sudo apt-get install code
When you install VSCode with the file .deb on Ubuntu 20.08, first, remove it:
sudo apt-get remove code
Add the repository in this link https://code.visualstudio.com/docs/setup/linux
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Udate the package cache and reinstall
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code
In the next time when you want to upgrade, just do:
sudo apt-get update
sudo apt-get upgrade code
Because your repository is missing information to upgrade VSCode, the above solution will fix it.
This is what I did to avoid the annoying message:
Remove vscode, if you already installed it.
sudo apt-get remove code
Add repositories, update and install:
sudo add-apt-repository -y "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main "
sudo apt update
sudo apt -y install code
If you have already installed VS code, go to the terminal and type two different commands:
sudo apt update
sudo apt-get upgrade code
The following commands work for me (for Linux) :
wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
Place those two commands into an executable Bash script called auto-update-VSCode, and you can simply run that from your shell any time Visual Studio Code says it's out of date.
I'm running Ubuntu 20.04 and this worked perfectly for me:
$ wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
$ sudo dpkg -i /tmp/code_latest_amd64.deb
Best way to update Vscode in Ubuntu:
sudo apt-get update
sudo apt-get install code
sudo apt-get update
sudo apt-get install code

error in installing libpq-dev in ubuntu 14.04 after installing psycopg2

I am trying to install all requirements of a project so i run the command
pip install -r requirements.txt
but it gives the error
Downloading/unpacking psycopg2==2.6 (from -r requirements.txt (line 58))
Downloading psycopg2-2.6.tar.gz (367kB): 367kB downloaded
Running setup.py (path:/tmp/pip_build_root/psycopg2/setup.py) egg_info for package psycopg2
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/psycopg2
Storing debug log for failure in /home/admin/.pip/pip.log
now i knew that i have to install postgresql-server so i used following command
sudo apt-get install postgresql
all good till now and then i ran
sudo apt-get install python-psycopg2
and then i ran my command to install requirements again but got the same error and then i searched on google and tried
sudo apt-get install libpq-dev
but i got following error
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libpq-dev : Depends: krb5-multidev but it is not going to be installed
Depends: comerr-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
now i am unable to detect and correct broken package...please help me...
I ran the following commands to repair broken package and then i successfully installed Psycopg2 and Postgresql ...
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install libpq-dev
sudo apt-get install krb5-multidev
sudo apt-get install libssl1.0.0=1.0.1f-1ubuntu2 ibcomerr2=1.42.9-3ubuntu1
sudo apt-get install libssl1.0.0=1.0.1f-1ubuntu2
sudo apt-get install ibcomerr2=1.42.9-3ubuntu1
sudo apt-get update
sudo apt-get install libpq-dev
apt-get install libssl-dev krb5-multidev comerr-dev
sudo apt-get install libssl-dev krb5-multidev comerr-dev
sudo apt-get dist-upgrade
sudo apt-get update
sudo apt-get install libssl-dev krb5-multidev comerr-dev
sudo apt-get install libcomerr2
sudo apt-get install comerr-dev
sudo apt-get install libcomerr2
sudo apt-get install comerr-dev
sudo apt-get install comerr-dev
sudo apt-get install 1.42.9-3ubuntu1.3
sudo apt-get install ibcomerr2=1.42.9-3ubuntu1
sudo apt-get install git
git clone https://github.com/kos0/addRemoveDistribution.git
cd addRemoveDistribution
sudo ./enableDisableDistribution.pl enable security
sudo ./enableDisableDistribution.pl enable updates
sudo apt-get update
sudo apt-get install libpq-dev
sudo apt-get update
pip install -r requirements.txt
Just follow only Steps
sudo apt-get install git
git clone https://github.com/kos0/addRemoveDistribution.git
cd addRemoveDistribution
sudo ./enableDisableDistribution.pl enable security
sudo ./enableDisableDistribution.pl enable updates
sudo apt-get update
sudo apt-get install libpq-dev
sudo apt-get update
I Fixed issue by those above steps

Why I can't install a specific version of MongoDB?

I want install mongoDB 2.6.6, i follow this tutorial (http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/)
daniela.morais#tusk:/var/lib$ sudo apt-get install -y mongodb-org=2.6.6 mongodb-org-server=2.6.6 mongodb-org-shell=2.6.6 mongodb-org-mongos=2.6.6 mongodb-org-tools=2.6.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.6.6' for 'mongodb-org' was not found
E: Version '2.6.6' for 'mongodb-org-server' was not found
E: Version '2.6.6' for 'mongodb-org-shell' was not found
E: Version '2.6.6' for 'mongodb-org-mongos' was not found
E: Version '2.6.6' for 'mongodb-org-tools' was not found
To install mongodb 2.6 you'll need to follow this tutorial: http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu
After adding the public key,
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
the differentiating step is adding this source:
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
Then you can install 2.6 with
sudo apt-get update
sudo apt-get install -y mongodb-org
When I ran this installation on Ubuntu I get 2.6.8. You can check by using
mongod --version
If you enter apt-cache show <pkgname> it will give you a list of versions that are available form your package repository.
Try: apt-cache show mongodb-org.
If you enter apt-cache show mongodb-org | grep Version it will show you only the version numbers.
If you get "E: No packages found", you need to create the file /etc/apt/sources.list.d/mongodb-org-3.0.list as described on the page you linked first, then run sudo apt-get update.

Using Kivy on Eclipse Indigo, Ubuntu 10.04 & Python 2.7

I would like to use Kivy on Eclipse Indigo on Ubuntu 10.04. I understand that python 2.7 is required (2.6 is the default on 10.04) and have python 2.7 installed as well. I've done lots of research but not found an answer. Can I do this and if so how? I don't want to upgrade ubuntu nor Eclipse since this would probably destabilise existing developments.
Kivy and Eclipse are not related, and Eclipse is not necessary for running or editing Kivy programs. I can help to answer the Kivy part of your question, and will leave Eclipse to others.
Since Ubuntu 10.04 is out of support, it's hard to tell which required system packages are not available. This will probably be the most tedious part of the process. For Kivy on Ubuntu 12.04 you need:
sudo apt-get install -y build-essential mercurial git python2.7 python-dev ccache ffmpeg libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev unzip
Some of those packages will have different versions on Ubuntu 10.04. Hopefully they are all available in some form.
Next you need to bootstrap an up-to-date Python setuptools environment:
sudo apt-get remove --purge -y python-virtualenv python-pip python-setuptools
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python2.7
rm -f setuptools*.zip
sudo easy_install-2.7 -U pip
Now you can install an up-to-date Cython:
sudo apt-get remove --purge -y cython
sudo pip2.7 install -U cython
Next you can install an up-to-date NumPy, which is required for PyGame:
sudo apt-get remove --purge -y python-numpy
sudo pip2.7 install -U numpy
Now you can install an up-to-date PyGame:
sudo apt-get remove --purge -y python-pygame
hg clone https://bitbucket.org/pygame/pygame
cd pygame
python2.7 setup.py build
sudo python2.7 setup.py install
cd ..
sudo rm -rf pygame
Now that all of the dependencies are met, you can install an up-to-date Kivy:
sudo apt-get remove --purge -y python-kivy
sudo pip install -U kivy