dpkg error: contains ununderstood data member - makefile

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

Related

go building error: lzma.h No such file or directory

I'm building payload-dumper-go, and I get this error,
❯ go build
# github.com/spencercw/go-xz
/home/ecarroll/go/pkg/mod/github.com/spencercw/go-xz#v0.0.0-20181128201811-c82a2123b492/compression.go:36:10: fatal error: lzma.h: No such file or directory
36 | #include <lzma.h>
| ^~~~~~~~
compilation terminated.
Here's an easier way for "next time".
github.com/ssut/payload-dumper-go uses Github Actions for building and testing.
Checking its .github/workflows/build.yml file:
...
steps:
- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install git golang liblzma-dev
...
The last quoted line contains the needed dependencies, namely git, golang and liblzma-dev.
I solve this by brute force trying all lzma stuff that Debian had. The actually packaged needed was,
sudo apt install liblzma-dev
packages that didn't work,
lzma-dev
golang-github-kjk-lzma-dev

Problem in install gtest, can not compile it due to huge errors

Tons of compile errors occur when make.
What I did are itemized:
My operation is shown itemized:
yum install git
yum install gcc-c++
yum install cmake
yum install python
yum install zeromq-devel
Then :
git clone https://github.com/google/googletest.git
cd /googletest/googletest
[root#VM_16_11_centos googletest]# cmake CMakeLists.txt
-- Configuring done
-- Generating done
-- Build files have been written to:
/usr/local/qiuxin/googletest/googletest
`[root#VM_16_11_centos googletest]# make
Huge Error here!!!
In file included from
/usr/local/qiuxin/googletest/googletest/src/gtest-all.cc:38:0:
/usr/local/qiuxin/googletest/googletest/include/gtest/gtest.h: In
member function 'virtual
testing::Test::Setup_should_be_spelled_SetUp*
testing::Test::Setup()':
solved. The mistake I made was:
1) I created a build folder in the googletest/googletest directory.
The right operation should be:
Create a build folder in googletest directory(NOT googletest/googletest directory.).
then:
cd build
cmake .. -DBUILD_GTEST=ON -DBUILD_SHARED_LIBS=ON
make
sudo make install
Everything goes well!

Bash on Ubuntu on Windows can't use `sudo apt-get install <packagename>`

I was excited to use bash on windows but quickly ran into an issue. I am trying to install build-essential, but I get a dependency issue. Upon trying to resolve with sudo apt-get install -f, I run into another error that doesn't make much sense. I've tried update and upgrade, but that didn't work either. F
barzevp#UK-LT-8356:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
libc6-dev : Depends: linux-libc-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
barzevp#UK-LT-8356:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libfreetype6 os-prober
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-libc-dev
The following NEW packages will be installed
linux-libc-dev
0 to upgrade, 1 to newly install, 0 to remove and 43 not to upgrade.
5 not fully installed or removed.
Need to get 0 B/767 kB of archives.
After this operation, 3,946 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 28660 files and directories currently installed.)
Preparing to unpack .../linux-libc-dev_3.13.0-123.172_amd64.deb ...
Unpacking linux-libc-dev:amd64 (3.13.0-123.172) ...
dpkg: error processing archive /var/cache/apt/archives/linux-libc-dev_3.13.0-123.172_amd64.deb (--unpack):
unable to install new version of /usr/include/linux/netfilter_ipv6/ip6t_hl.h': File exists
E: Sub-process /usr/bin/dpkg returned an error code (1)
Full log of what led to the error in Bash on Ubuntu on Windows terminal is here:
https://pastebin.com/dq2D2Gtz
I don't have a solution, but I see the root of the problem. It seems to have to do with case sensitivity on the filesystem. The package for linux-libc-dev puts two copies of a file in /usr/include/linux/netfilter_ipv6 with only a difference in case; ip6t_HL.h, and ip6t_hl.h. After placing ip6t_HL.h, it attempts to rename ip6t_hl.h.dpkg-new to ip6t_hl.h. The system call to rename the file fails, claiming that ip6t_hl.h already exists
On a "real" linux system, ip6t_HL.h and ip6t_hl.h would clearly be different files. Under WSL they probably had some strange incompatibilities to work out between NTFS's default case insensitive FS and unix's default case sensitivity.
You can duplicate the problem by hand e.g., with
echo hi > foo.H
echo hi > foo.h-new
mv foo.h-new foo.h
mv: cannot move 'foo.h-new' to 'foo.h': File exists
strace output:
rename("/usr/include/linux/netfilter_ipv6/ip6t_HL.h.dpkg-new", "/usr/include/linux/netfilter_ipv6/ip6t_HL.h") = 0
open("/usr/include/linux/netfilter_ipv6/ip6t_hl.h.dpkg-new", O_WRONLY) = 10
fsync(10) = 0
close(10) = 0
rename("/usr/include/linux/netfilter_ipv6/ip6t_hl.h.dpkg-new", "/usr/include/linux/netfilter_ipv6/ip6t_hl.h") = -1 EEXIST (File exists)
write(2, "dpkg: error processing archive /"..., 199dpkg: error processing archive /var/cache/apt/archives/linux-libc-dev_4.4.0-98.121_amd64.deb (--install):
unable to install new version of '/usr/include/linux/netfilter_ipv6/ip6t_hl.h': File exists
) = 199
I had the same problem. Like #dmattp I found that it this is because, unfortunately, the package contains some (header) files with names that are distinct only by letter case, and that the wonderful WSL file system has an inconsistency regarding case sensitiveness.
Here is a workaround, assuming that the package has name linux-libc-dev_3.13.0-123.172_amd64.deb:
cd any-temp-dir
apt-get download linux-libc-dev
ar x linux-libc-dev_3.13.0-123.172_amd64.deb
tar xJf data.tar.xz # ignore all erors like ./usr/include/linux/netfilter_ipv4/ipt_ttl.h: Cannot open: Input/output error
tar cJf data.tar.xz ./usr
ar rcs linux-libc-dev_3.13.0-123.172_amd64-patched.deb debian-binary control.tar.gz data.tar.xz
sudo dpkg -i linux-libc-dev_3.13.0-123.172_amd64-patched.deb
It says dependencies aren't being installed, so try:
sudo apt-get install linux-libc-dev
If that doesn't work try:
sudo apt-get install --reinstall build-essential
This will reinstall build-essential. Hope this helps, cheers!

Properly Removing .deb Files

I installed LibreOffice on a server with a shell script using the following
sudo -S dpkg -r LibreOffice_5.1.1.3_Linux_x86-64_deb/DEBS/*.deb
Now I would like to change to a different version and am attempting to uninstall the previous version by using:
sudo -S dpkg -i LibreOffice_5.0.6.3_Linux_x86-64_deb/DEBS/*.deb
which yields the error
dpkg: error: you must specify packages by their own names, not by
quoting the names of the files they come in
After doing some research I found this thread and it seems I will need to call the dpkg with the name of the actual debian files, but doing dpkg -r libreoffice results in the error
dpkg: warning: ignoring request to remove libreoffice which isn't
installed
I have also tried using sudo apt-get remove libreoffice-core, which does not seem to be successful. Is there an automated way to remove all of the installed .deb files so that I can safely install the new version?
For reference the following files are shown in the DEBS folder
libobasis5.1-base_5.1.1.3-3_amd64.deb
libobasis5.1-filter-data_5.1.1.3-3_amd64.deb
libobasis5.1-xsltfilter_5.1.1.3-3_amd64.deb
libobasis5.1-calc_5.1.1.3-3_amd64.deb
libobasis5.1-gnome-integration_5.1.1.3-3_amd64.deb
libreoffice5.1_5.1.1.3-3_amd64.deb
libobasis5.1-core_5.1.1.3-3_amd64.deb
libobasis5.1-graphicfilter_5.1.1.3-3_amd64.deb
libreoffice5.1-base_5.1.1.3-3_amd64.deb
libobasis5.1-draw_5.1.1.3-3_amd64.deb
libobasis5.1-images_5.1.1.3-3_amd64.deb
libreoffice5.1-calc_5.1.1.3-3_amd64.deb
libobasis5.1-en-us_5.1.1.3-3_amd64.deb
libobasis5.1-impress_5.1.1.3-3_amd64.deb
libreoffice5.1-debian-menus_5.1.1-3_all.deb
libobasis5.1-en-us-base_5.1.1.3-3_amd64.deb
libobasis5.1-kde-integration_5.1.1.3-3_amd64.deb
libreoffice5.1-dict-en_5.1.1.3-3_amd64.deb
libobasis5.1-en-us-calc_5.1.1.3-3_amd64.deb
libobasis5.1-librelogo_5.1.1.3-3_amd64.deb
libreoffice5.1-dict-es_5.1.1.3-3_amd64.deb
libobasis5.1-en-us-math_5.1.1.3-3_amd64.deb
libobasis5.1-math_5.1.1.3-3_amd64.deb
libreoffice5.1-dict-fr_5.1.1.3-3_amd64.deb
libobasis5.1-en-us-res_5.1.1.3-3_amd64.deb
libobasis5.1-ogltrans_5.1.1.3-3_amd64.deb
libreoffice5.1-draw_5.1.1.3-3_amd64.deb
libobasis5.1-en-us-writer_5.1.1.3-3_amd64.deb
libobasis5.1-onlineupdate_5.1.1.3-3_amd64.deb
libreoffice5.1-en-us_5.1.1.3-3_amd64.deb
libobasis5.1-extension-beanshell-script-provider_5.1.1.3-3_amd64.deb
libobasis5.1-ooofonts_5.1.1.3-3_amd64.deb
libreoffice5.1-impress_5.1.1.3-3_amd64.deb
libobasis5.1-extension-javascript-script-provider_5.1.1.3-3_amd64.deb
libobasis5.1-ooolinguistic_5.1.1.3-3_amd64.deb
libreoffice5.1-math_5.1.1.3-3_amd64.deb
libobasis5.1-extension-mediawiki-publisher_5.1.1.3-3_amd64.deb
libobasis5.1-postgresql-sdbc_5.1.1.3-3_amd64.deb
libreoffice5.1-ure_5.1.1.3-3_amd64.deb
libobasis5.1-extension-nlpsolver_5.1.1.3-3_amd64.deb
libobasis5.1-python-script-provider_5.1.1.3-3_amd64.deb
libreoffice5.1-writer_5.1.1.3-3_amd64.deb
libobasis5.1-extension-pdf-import_5.1.1.3-3_amd64.deb
libobasis5.1-pyuno_5.1.1.3-3_amd64.deb
libobasis5.1-extension-report-builder_5.1.1.3-3_amd64.deb
libobasis5.1-writer_5.1.1.3-3_amd64.deb
Use dpkg-query -l to get a list of installed packages. You can also search the list with dpkg-query -l 'libre*' for everything beginning with 'libre'.
You can then use the displayed package name to remove or purge them with dpkg.
Using dpkg --remove PackageNameHere will let configuration files untouched and delete only the binaries.
With dpkg --purge AgainYourPackageNameHere you would delete everything regarding the package.
we can also use dpkg-query - W to list the installed packages.
For example to search for installed sqlectron
$>dpkg-query -W 'sqlec**'
sqlectron 1.37.1
then you can delete the package using dpkg -r|--remove 'package-name' or dpkg -P|--purge 'package-name' command.

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

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

Resources