I am using debian 9.4, the kernel version shown by uname -a is different, what's the actual kernel version? What does '4.9.82-1+deb9u3' mean?
Linux debian 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux
apt-get source linux can get the source code of current kernel, then I can get original kernel tar file and debian patch.
$ls
linux-4.9.82 linux_4.9.82-1+deb9u3.dsc
linux_4.9.82-1+deb9u3.debian.tar.xz linux_4.9.82.orig.tar.xz
linux_4.9.82-1+deb9u3.debian.tar.xz contains many files, what are them used for? how to patch the it to linux_4.9.82.orig.tar.xz ?
linux-4.9.82 is the kernel source folder outputted by apt-get source command, which can be compiled to vmlinux. However, I usually can't debug the crash dump files with the vmlinux, as 'crash' command gives the error message: mismatch version. Should I download kernel 4.9.0 from kernel.org instead of linux-4.9.82 to debug my current running kernel ?
You have the package version. The name is made by:
4.9.82: the upstream version
-1: separator and Debian version of 4.9.82 upstream package. Note: if Debian is also upstream of a package, this field is skipped.
+deb9u3: this is a sort of micro-version. The +deb is used for security advisories, so minimal changes compared with 4.9.82-1. The 9 is the Debian version, and u3 is the third security version.
But kernels are different (compared with most of other packages): one could install many in parallel (but it will use only one). So in the package name you may have linux-image-4.9.0-3-amd64. In my system this package has version 4.9.30-2+deb9u1. So 4.9 is the kernel version. -amd64 is the architecture, this is the third major Debian version (-3) of 4.9(.0) series, which is based on 4.9.30.
the command uname will give you the kernel (as package name, so near the capability) in the field kernel-release and the package version (so exact reference to source) in the field kernel-version).
For the main question: I would use original kernel, and compile with upstream method (if I think the bug is kernel related, so it is easier to discuss with kernel maintainers), or I would use Debian sources (e.v. with patch), and build the kernel with Debian tools (and install the package to install the kernel), if I think the problem is in Debian, or just on old kernel versions.
Related
How to run g++-6 on debian 10, need to compile older buildroot files.(NCurves(host-ncurses-5.9) is crashing)
I have tried to patch the files in the buildroot but it like walking into a swamp.
Fixing one problem to find the next problem.
Tried compiling 6.3 compiler from source but this is crashing with the latest gcc-8 compiler.
Any suggestions? (I always assumed that older compilers should compile with newer compilers)
My other options are:
* Running virtual machine (VM or docker) with Debian Jessie
* Compile an older compiler with a docker GCC compiler.(No idea if this works)
* maybe turn off the compiling of the local files in buildroot? (Could not find any info on this)
There is a gcc-6 package available in Debian. So you just need to sudo apt install gcc-6. link
No reason to compile gcc from source unless you need a very specific version, but even then Docker is the far easier solution since gcc has an official repo on Docker Hub. I'd also double check that you have the proper ncurses dev library installed.
The overall best solution is to containerize the correct build environment (compiler, libraries, etc.), though. It ensures you'll always be able to build the product, especially if a re-factor is not viable.
I'm having trouble installing the "car" package after upgrading R to 3.6.2 (from 3.4) on Ubuntu 16.04 due to (at least one) dependency (nloptr) that cannot be installed either. It seems to be a problem of the C++ compiler (it is using some deprecated "config" settings, however I'm lost trying to fix this).
I called the following command in R (from the terminal):
install.packages("nloptr")
Error Information:
Installing package into ‘/home/heike/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://ftp.fau.de/cran/src/contrib/nloptr_1.2.1.tar.gz'
Content type 'application/x-gzip' length 2448313 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
* installing source package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
'config' variable 'CPP' is deprecated
'config' variable 'CXXCPP' is deprecated
checking whether the C++ compiler works... no
configure: error: in /tmp/RtmpPLaJFA/R.INSTALL5e5ed06eeac/nloptr': configure: error: C++ compiler cannot create executables See config.log' for more details
ERROR: configuration failed for package ‘nloptr’
Steps taken so far
changed CRAN mirror and source.list entry
uninstalled and reinstalled R 3.6.2 (also on different machine), same issue remained
System Information
OS Version: Ubuntu 16.04 (x86_64-pc-linux-gnu (64-bit))
R Version: 3.6.2 (2019-12-12)
We have done a lot of work to make nloptr installation better. In essence, you have several choices:
if the system version of the nlopt library is present, use it -- that is the easiest so try installing it via sudo apt-get install libnlopt-dev and then reinstall
if it is not found, then a download of the source and build happens, and this seems to fail on your almost four year old Ubuntu system as it is hard to support all flavours --- but this works swimmingly on newer ones (I run Ubuntu too, but currently 19.10)
there are binaries for you as, see the Ubuntu packages page -- however these may not match your current R version which is mismatches to your distro R version
dependening on where you got R from (did you install a .deb?) you could use the Michael Rutter PPAs to get a current r-cran-nloptr
All this can also be discussed in detail on the r-sig-debian list for R on Debian and Ubuntu.
Edit: In response to the comment below:
To see what package apt knows about, do apt-cache policy r-cran-nloptr. Per the link I gave above we know Ubuntu has a r-cran-nloptr for your (very old) Xenial installation. However it will clash with the very new and current R you have running. Such as the costs of mixing and matching.
To access the Rutter PPAs and its over four thousand current binaries see the fourth paragraph at the top of the Ubuntu at CRAN README
Edit 2: I may have been too pessimistic. The Rutter PPA for the current R binaries has trusty, xenial and bionic. See https://launchpad.net/~marutter/+archive/ubuntu/c2d4u3.5
Error: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /root/workspace/backend/node_modules/uWebSockets.js/uws_linux_x64_72.node)
Latest glibc version for CentOS 7 is 2.17.
I know that latest version for CentOS 8 is 2.30 but I can't upgrade, because my VDS depends on host's machine kernel (which is very old).
Is there any way to run/compile it with glibc-2.17 or update glibc?
EDIT:
My kernel version is 2.6.32-042stab141.3.
I can build it and install to /opt/glibc-2.18 without errors, but when I trying to use this I see Segmentation fault error.
P.S. I builded it successfully on Fedora 23 with same OpenVZ kernel.
I have built a custom binary (and tutorial) that will solve your exact problem.
Read it here: https://github.com/dominicklee/uWebSockets.js-for-Centos7
Is there any way to run/compile it with glibc-2.17
Yes: just do it (download source, build on your target machine, profit).
or update glibc?
You didn't say what your "very old kernel" is, but if GLIBC-2.18 supports it, then yes, you can update GLIBC.
However, any mistake you make in the process may make your system un-bootable. See this answer.
I have one C++ binary which is running smoothly on local centos. Recently, I started learning docker and trying to run my C++ application on centos docker.
Firstly, I pulled centos:latest from docker hub and installed my C++ application on it and it ran successfully, without any issue. Now i installed docker on raspberry-pi and pulled centos again and tried to ran the same application on it but it gave me error.
bash : cannot execute binary file
Usually, this error comes when we try to run application on different architecture then the one they are built on. I checked cat etc/centos-release on raspberry-pi and result is CentOS Linux release 7.6.1810 (AltArch),where as result on local centos is CentOS Linux release 7.6.1810 (Core)
uname -a on both devices is as follows
raspberry-pi, centos docker Linux c475f349e7c2 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l armv7l armv7l GNU/Linux
centos, centos docker Linux a57f3fc2c1a6 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
EDIT:
Also, file myapplication
TTCHAIN: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.24, BuildID[sha1]=287b501c8206893f7819f215ee0033586212b143, with debug_info, not stripped
My question is how can i ran the same native application of centos, pulled from docker on raspberry-pi model 3.
Your application has been built for x86-64. Intel x86-64 binaries CAN NOT run on an ARM processor.
You have two paths to pursue:
If you don't have source code for the application, you will need an x86-64 emulator that will run on your Raspberry Pi. Considering the Pi's lesser capabilities and Intel's proclivity to sue anyone who creates an emulator for their processors, I doubt you'll find one that's publicly available.
If you have the source code for the application, you need to rebuild it as a Raspberry Pi executable. You seem to know that it was written in C++. GCC and other toolchains are available for the Raspberry Pi (most likely a "yum install gcc" on your Pi will grab the compiler and tools for you). Building the application should be extremely similar to building it for x86_64.
You could find a cross-compiler that would let you build for the Pi from your x86_64 box, but that can get complicated.
Could be that you are trying to run a 64-bit binary on a 32-bit processor, would need more information to know for sure though.
You can check by using the file command in the shell. You may have to re-compile on the original system with the -m32 flag to gcc.
Please do a "uname -a" on both devices and post the results.
Most likely the processor or library type doesn't match.
I presume (hope) you're not trying to run an x86-compiled app on a Pi. Although Docker is available for both processor types, Docker will not run x86 binaries on Pi or vice versa.
Actually, AltArch currently means one of the following architectures... ppc64, ppc64le, i386, armhfp (arm v7 32-bit), aarch64 (arm v8 64-bit). Core suggests the mainstream x86 and x86_64 builds of CentOS.
Yep, I bet that's what it is...you can't just transfer an x86 binary to a Raspbian and expect it to work. The application must be rebuilt for the platform.
I have a c++ code that is written and compile on my PC and executed on a remote server.
I changed recently my pc ans so set up everything uptodate on it. But now execution of my code on the unchanged server failed with this error:
./ReactionThermo: relocation error: ./ReactionThermo: symbol _ZTINSt8ios_base7failureB5cxx11E, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
I look a bit on the web and it appears to be gcc fault. And indeed it's on my pc 5.4 and 4.8 on my server. I tried to upgrade it but got following error:
sudo apt-get install gcc-4.9
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
gcc-4.9 : Depends: cpp-4.9 (= 4.9.4-2ubuntu1~14.04.1) but it is not going to be installed
Depends: libgcc-4.9-dev (= 4.9.4-2ubuntu1~14.04.1) but it is not going to be installed
munge : Depends: libmunge2 (= 0.5.11-1ubuntu1) but 0.5.11-1ubuntu1.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I tried the apt-get -f install comand but it's not improving thinks.
Any ideas.
Thanks
PS: I knoz it's look like GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference but I don't want tu downgrade cpp, rather to upgrade it
In general, you need to build C/C++ binaries on the oldest operating system version you want to support, using the system compiler (or other vendor-supported compilers such as the Toolchain Module for SUSE Linux Enterprise Server or Developer Toolset for Red Hat Enterprise Linux). You cannot compile your program on a newer system and copy it to a different environment with an older (or different) operating system release. In simple cases, it might work, but in other cases, you will get dynamic linker failures at run time (like you did), or even silent data corruption.
Furthermore, you should look at build tools such as pbuilder and mock to automate building your software in a well-defined build environment.