Why is /var/lib/dpkg/status missing on a BitBake-generated OS? - apt

I have installed apt onto a system built by BitBake by adding the apt package to the IMAGE_INSTALL variable in my recipe.
apt-get and apt-cache now execute on the built system, but if I try to do anything useful with them (such as apt-get update or apt-cache search), I get the following error:
E: Could not open file /var/lib/dpkg/status - open (2: No such file or directory)
E: The package lists or status file could not be parsed or opened
After some preliminary searching, I found this exchange on the Yocto Project mailing list:
Hi,
I have some requirement with apt-get in yocto genearted rootfs.
I built the yocto source code with enabling the apt package.
But after booting the image on my machine and run the "apt-get" command for installing some package it gives the following error.
Could not open the file /var/lib/dpkg/status open(2: no such a file or directory).
The package lists or status files could not be parsed or opened.
This error is because you need to add package-management to EXTRA_IMAGE_FEATURES in local.conf,
PACKAGE_CLASSES ?= "package_deb"
EXTRA_IMAGE_FEATURES = "debug-tweaks package-management"
I've added package-management but don't see any different output.
After a touch /var/lib/dpkg/status, apt-get update returns the following:
Reading package lists...Done
How can I get apt into a functioning state through the use of BitBake metadata?

I have found a similar thread from the NXP website.
You would need to set up your own web server and provide all those packages and add the server URL to the source list. SourceList
In addition, you have to update the package manifest by running bitbake package-index and add PACKAGE_CLASSES ?= " package_deb" to conf/local.conf
I have successfully set up OPKG before. The steps are similar, you can find it here

Related

The term 'Write-ChocolateyFailure' is not recognized as the name of a cmdlet

So I'm trying to install yasm on Windows 11 with Chocolatey, but an error occurs, does anyone know how to solve this error?
PS C:\WINDOWS\system32> choco install yasm
Chocolatey v1.2.0
Installing the following packages:
yasm
By installing, you accept licenses for the packages.
Progress: Downloading yasm 1.2.0... 100%
yasm v1.2.0
yasm package files install completed. Performing other installation steps.
The package yasm wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): Y
WARNING: Url has SSL/TLS available, switching to HTTPS for download
Downloading yasm 64 bit
from 'https://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win64.exe'
Progress: 100% - Completed download of C:\ProgramData\chocolatey\lib\yasm\tools\yasm.exe (779.5 KB).
Download of yasm.exe (779.5 KB) completed.
C:\ProgramData\chocolatey\lib\yasm\tools\yasm.exe
ERROR: The term 'Write-ChocolateyFailure' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The install of yasm was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\yasm\tools\chocolateyInstall.ps1'.
See log for details.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- yasm (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\yasm\tools\chocolateyInstall.ps1'.
See log for details.
I couldn't find a solution on the internet, so I asked here.
The package uses helpers (Write-Chocolatey-Failure) that have been deprecated for some time and subsequently removed. To restore the functionality you can use the chocolatey-compatibility.extension package.
However, two things:
The package is trying to write a failure message, so something is likely broken with the package.
The package was last updated in 2013 so YMMV with the software it's downloading working at all.
This happens because you are trying to install a package that still uses a syntax that is no longer supported in Chocolatey CLI. You have two options to resolve this issue.
The first and best option is to try contacting the package's maintainer and ask them to update the package to follow modern standards of how a package should be written.
The second option that will fix your current issue is to install a compatibility package to reintroduce removed helpers that are no longer supported.
You can install this package by running: choco install chocolatey-compatibility.extension and then try installing the yasm package again.

Cannot Find libatomic.so.1

I'm trying to build snappy, but I end up getting the error
error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
When I go look in /lib/gcc/x86_64-redhat-linux/8/ I do find a file libatomic.so
Which has the contents
INPUT ( /usr/lib64/libatomic.so.1.2.0 )
then if I go looking in /usr/lb64/ only these files exist
libatomic_ops_gpl.so.1
libatomic_ops_gpl.so.1.1.2
libatomic_ops.so.1
libatomic_ops.so.1.1.1
I try doing yum install libatomic_ops.x86_64, it says nothing to do. That is the only package that comes up when doing yum search libatomic.
I'm confused with how to solve this issue. Thanks!
For what it matters, this is a redhat 8.6 machine.
This was solved by running dnf install gcc, this updated gcc and allowed for yum install libatomic to work

Why can't pip find pysvn?

I'm working on a project which was written in Python 2, and I'm upgrading it to Python 3. So far, I've just been finding minor syntax errors which are easily fixable. What I've done is created a new project in Python 3, ensured that it worked, and copies chunks of code from the old project into the new one.
Right now, I'm having trouble with pysvn. Initially, I was getting this error:
ImportError: No module named 'pysvn'
At this point, I tried using pip install pysvn, which didn't work. I got the following:
pip install pysvn
Collecting pysvn
Could not find a version that satisfies the requirement pysvn (from versions:)
No matching distribution found for pysvn
So then after a bit of research, I went to the pysvn download site and tried:
>pip install --index-url http://pysvn.tigris.org/project_downloads.html pysvn, which gave me this error:
Collecting pysvn
The repository located at pysvn.tigris.org is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pysvn.tigris.org'.
and also the same error as when I tried >pip install pysvn.
My next step was to manually download the .exe file for the version I needed, and I was able to successfully install pysvn. I have checked the site-packages directory, and pysvn is indeed there, but pip still can't tell me anything about it:
>pip show pysvn
>
When I do this for another installed module, selenium for example, I get the following:
pip show selenium
Metadata-Version: 1.1
Name: selenium
Version: 2.49.2
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: ...\lib\site-packages
Requires:
I was able to verify that the installation of pysvn was successful because my project now runs instead of giving me that ImportError.
So why can pip not give me information for another module in the same directory that was successfully installed?
As it turns out, because I didn't use pip install for pysvn, pip didn't know that pysvn existed. Because it wasn't available from PyPI (the Python Package Index), there was no way that pip could see it (because that's where pip goes first to find packages that it's attempting to install).
From the pip user guide:
pip supports installing from PyPI, version control, local projects, and directly from distribution files.
Since I had eventually downloaded pysvn from its own download site (which was not any of the above 4 options) and ran the .exe manually, pip simply doesn't know about it even though it's in the same directory as other packages installed by pip.
I suppose I could've also retrieved the distribution files and used pip with those, but my workaround did the trick.
My way on linux:
Get sources from here
tar -zxf pysvn-1.9.10.tar.gz
apt-get install subversion libsvn1 libsvn-dev make g++
cd pysvn-1.9.10/Source
python setup.py configure --pycxx-dir=/pysvn-1.9.10/Import/pycxx-7.1.3/
make
Here i've got errors below:
Compile: /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxsupport.cxx into cxxsupport.o
/pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxsupport.cxx:42:10: fatal error: Src/Python3/cxxsupport.cxx: No such file or directory
#include "Src/Python3/cxxsupport.cxx"
Compile: /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxextensions.c into cxxextensions.o
/pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxextensions.c:42:10: fatal error: Src/Python3/cxxextensions.c: No such file or directory
#include "Src/Python3/cxxextensions.c"
It is needed to edit that files:
vi /pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxsupport.cxx
change #include "Src/Python3/cxxsupport.cxx" to
#include "Python3/cxxsupport.cxx"
and same on second file. Than make again:
make clean && make
...
Compile: /code/pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxxextensions.c into cxxextensions.o
Compile: /code/pysvn-1.9.10/Import/pycxx-7.1.3/Src/IndirectPythonInterface.cxx into IndirectPythonInterface.o
Compile: /code/pysvn-1.9.10/Import/pycxx-7.1.3/Src/cxx_exceptions.cxx into cxx_exceptions.o
Link pysvn/_pysvn_3_7.so
Then just copy it to the site-packages (change to yours directory):
mkdir /usr/local/lib/python3.7/site-packages/pysvn
cp /code/pysvn-1.9.10/Sources/pysvn/__init__.py /usr/local/lib/python3.7/site-packages/
cp /code/pysvn-1.9.10/Sources/pysvn/_pysvn*.so /usr/local/lib/python3.7/site-packages/

error while installing snmp package in SUSE 11

I am trying to install SNMP package in SUSE Linux enterprise server 11. I downloaded net-snmp-5.6.1-3.3.x86_64.rpm and installed with the below command
UKGBDCESRPL048:/opt/packages # rpm -ivh --nodeps net-snmp-5.6.1-3.3.x86_64.rpm
warning: net-snmp-5.6.1-3.3.x86_64.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 3dbdc284
Preparing...
##################################### [100%]
1:net-snmp
##################################### [100%]
Updating /etc/sysconfig/net-snmp...
But when I try to start snmpd service, I am getting an error below:
UKGBDCESRPL048:/opt/packages # /etc/init.d/snmpd start
Starting snmpd/usr/sbin/snmpd: error while loading shared libraries: libnetsnmpagent.so.25: cannot open shared object file: No such file or directory
startproc: exit status of parent of /usr/sbin/snmpd: 127
Please help me to properly install SNMP package.
Why are you trying to install the RPM with --nodeps? This breaks your RPM dependencies! Please remove the package again and try to install it without that option. This should fail with a list of additionally required RPM's.
You'll have to install them, too. BTW, I'm sure that at least the RPM libsnmp15 is missing, because libnetsnmpagent.so.25 is in there.
You could also configure SLES to use one or more (online) repositories after registering your machine with a license key. After that, a simple
zypper in net-snmp
should solve all dependencies automatically.
One more thing: net-snmp-5.6.1-3.3.x86_64.rpm doesn't seem to be a valid SLES 11 package. Latest version (even SP4) is 5.4.2.1-8.12.24.1. Where did you get the RPM from? Just wondering...

dpkg error: contains ununderstood data member

I'm trying to install a jailbreak tweak using make package install but I'm receiving this error from dpkg:
dpkg-deb: file `/tmp/_theos_install.deb' contains ununderstood data member data.tar.xz , giving up
dpkg: error processing /tmp/_theos_install.deb (--install):
subprocess dpkg-deb --fsys-tarfile returned error exit status 2
Errors were encountered while processing:
/tmp/_theos_install.deb
make: *** [internal-install] Error 1
So as far as I can tell it isn't able to understand the .xz extension, but I'm not sure why that file is being created. Thanks for the help.
I found out how to fix it. In $THEOS/makefiles/package/deb.mk replace this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
with this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -Zgzip -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
The .deb file is created because you told Theos build system to do that. The package install rule of the Makefile is creating the Debian package using xz compression. Now, this kind of compression is supported by versions of dpkg equal or higher than 1.15.6.
So, in order to solve your problem, you should update dpkg to a newer version or install Theos without packaging support. Probably a simple make install will do it.
In case that updating dpkg isn't possible and you don't want to install the program without package management support, the other (more painful) method is to change the algorithm in which the package is compressed. Here you have good information about how to do this.
In my case I was building a package on Ubuntu 18.04 and trying to install that package on Debian 7 (airgapped). I had to change the line in the Makefile that read:
dpkg --build $(DESTDIR)
..to:
dpkg-deb --build -Zgzip $(DESTDIR)
Thanks Connor!
Other option that you can try is to unpack the .deb that you where triying to install and repack with no XZ compression.
Unpack:
mkdir package/ && dpkg -x package.deb package/
Pack:
dpkg-deb --build -Zgzip package/
You can rename the resulting package with:
dpkg-name -o package.deb
Or simply name the package dir with the name of your package.
Important: In orther to perform this, you need to install dpkg-dev package:
sudo apt update
sudo apt install dpkg-dev

Resources