dpkg: why does instdir need admindir parameter on Mint 21 - linux-mint

We create a Debian package of our application using CPack which can be installed on Linux Mint 19 like this:
$ sudo dpkg -i --instdir=/opt myapp.deb
With Linux Mint 21 the (installed) dependencies are not resolved:
dpkg: dependency problems prevent configuration of myapp:
myapp depends on libsqlite3-0 however:
Package libsqlite3-0 is not installed.
...
After reading the dpkg man page I set the admindir parameter and the installation succeeds:
$ sudo dpkg -i --instdir=/opt --admindir=/var/lib/dpkg/ myapp.deb
If I do not set admindir to /var/lib/dpkg/ then the right environment is not found. Why is that? And why did it work without admindir on Mint 19? Using parameter root does not help because it expects the administrative directory to be a subdirectory of the instdir.

This is a bug, which seems I introduced in dpkg 1.21.0. I'll be preparing a fix and regression tests for dpkg 1.21.10 which should hit Debian unstable in few days I guess. For Mint, which seems to be based on Ubuntu, you'd need to request the Ubuntu people to consider including that fix once it's in Debian unstable, and then the Mint people to do the same. Otherwise you can specify both options as a workaround for now. :/
Please feel free to report this kind of problems upstream in the bug tracking system next time, I just happened to see this by accident today. :)

Related

Raspbian Jessie: Cannot mount NTFS external harddrive anymore after 'apt-get upgrade' (fuse device is missing)

After I used apt-get upgrade earlier today, my Raspberry Pi (Raspbian Jessie) stopped being able to automount my external harddrives anymore. Automounting worked perfectly fine before apt-get upgrade, but now I can't even manually mount my external HDDs anymore.
This is the error message I received:
pi#raspberrypi:~ $ sudo mount /dev/sda1 /mnt
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
'modprobe fuse' gives me the same error message:
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'
I reinstalled the kernel and bootloader using this command:
sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
But this did not help.
From reading other forum posts, it may look like my kernel and fuse might not be compatible - but how would that have happened? I feel I'm a bit out of my depth here.
Some forum posts suggested a restart will help, but this didn't solve the issue for me.
Alternatively, I also found a post from drownboat on Reddit from two years ago that looks promising - but to be honest, I have no idea if this is just another red herring or if this is indeed the problem I'm facing. In any case, I'm not sure what exactly/how drownboat did it:
I suspect that what is happening is that updates to the kernel and
grub config are being written to the /boot folder, but not onto the
boot device. This has caused the modules and the kernel to go out of
sync. [...]
I fixed it by adding /boot back to /etc/fstab, rebooting to another kernel where the modules were still working, thus mounting /boot, and finally reinstalling apt-get install --reinstall linux-image-3.16.0-4-amd64.
I would greatly appreciate any help!
Some more info:
uname -a
Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016
armv7l GNU/Linux
dpkg -s fuse
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 103
Maintainer: Laszlo Boszormenyi (GCS)
Architecture: armhf
Version: 2.9.3-15+deb8u2
Depends: libc6 (>= 2.4), libfuse2 (= 2.9.3-15+deb8u2), adduser, mount (>= 2.19.1), sed (>= 4), udev | makedev
Conffiles:
/etc/fuse.conf 298587592c8444196833f317def414f2
Description: Filesystem in Userspace
Filesystem in Userspace (FUSE) is a simple interface for userspace programs to
export a virtual filesystem to the Linux kernel. It also aims to provide a
secure method for non privileged users to create and mount their own filesystem
implementations.
Homepage: http://fuse.sourceforge.net/
I FOUND THE SOLUTION (see further below for details)! It turned out that the boot partition was not mounted and the operating system reverted to the old kernel before the apt-get upgrade. So I just had to make sure that /boot was automounted at startup so the correct kernel was used.
Further steps in my error analysis ():
OK so I managed to fix the issue myself. It really just turned out that the /boot partition was not mounted and thus my Raspberry Pi reverted to the old kernel instead of the fancy new one that came with apt-get upgrade.
I found the problem by using uname -r, which gave me '4.9.35-v7+' as an answer. This was strange because the original error message had a different version number:
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could
not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'
(My emphasis)
When I navigated to /lib/modules using cd /lib/modules I also saw this:
pi#raspberrypi:/lib/modules $ ls
4.9.35+ 4.9.35-v7+
So the error message about a fuse device missing really seemed to have something to do with a mismatch of kernel and fuse versions. The discrepancy between version numbers led me to believe that the wrong kernel was being used (like drownboat also stated in their Reddit post two years ago).
This is how I fixed the problem (SOLUTION):
sudo nano /etc/fstab/
Then I added the following lines to fstab:
# automount /boot partition at startup
/dev/mmcblk0p6 /boot vfat defaults 0 2
After rebooting, I used sudo raspi-config to check if the boot partition was mounted properly (raspi-config will only let you enter its menu if the partition is mounted, otherwise it will tell you that you need to mount the boot partition first).
Then I ran sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel again to doubly ensure that the latest kernel was installed on the boot partition too - but I don't know if this was a crucial step.
Finally, after another restart, I was able to mount/automount my external harddrives again.
Hope this helps anyone else out there having the same issue as me! :)
In my situation, the solution is pretty simple.
I run apt update and apt upgrade -y and then apt install ntfs-3g, after these, I try to mount the disk and met this error.
The solution is just reboot
After reboot, try to mount again, and thing worked well.
I had the same issue trying to get Open Media Vault working. There were missing or unmatched kernel files, outdated libraries etc. I ran the updates in the link below and got it working.
Update system's package list
sudo apt-get update
upgrade all installed packages to their latest versions:
sudo apt-get dist-upgrade
https://www.raspberrypi.org/documentation/raspbian/updating.md
I had this problem trying to mount a FAT32 USB on Buster Lite with
pmount /dev/disk/by-label/<my-usb-label>
The messages implied the system was trying to mount an ntfs device. 'NTFS signature missing' etc.
Before trying anything clever, I tried #Kenneth's suggestion of a reboot. It fixed the problem.
Worrying to see Linux behaving like Windows 8-{
Crash after kernel upgrading
apt-get update & dist-upgrade
impossible to mount ntfs usb disk
modprobe: FATAL: Module fuse not found in directory /lib/modules/5.15.87-v7+
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
Thanks a lot for this workaround :
sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

What's the root cause of error "Failed dependencies: /bin/sh is needed by xxx" on RHEL?

When I install a rpm package on RHEL using rpm, I got a error message just like "Failed dependencies: /bin/sh is needed by xxx".
I checked that /bin/sh is there and it links to /bin/bash and bash works well.
I found a solution that to add --nodeps to the rpm command to solve this problem. But I really want to know what is the root cause?
How to reproduce this error on a fresh install of Ubuntu 14.04.
Fresh install of Ubuntu 14.04
Do a sudo apt-get install rpm
download the nomachine rpm 64 bit linux from https://www.nomachine.com/download/download&id=4
Do a chmod +x nomachine_4.2.25_1_x86_64.rpm on it
extract it like this:
el#apollo:~Desktop$ sudo rpm -i nomachine_4.2.25_1_x86_64.rpm
rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
error: Failed dependencies:
/bin/sh is needed by nomachine-4.2.25-1.x86_64
So that is the error. To fix it I followed its advice to use alien.
sudo alien -i nomachine_4.2.25_1_x86_64.rpm --scripts
And no machine installed correctly.
I have find root cause for this problem. The rpm-libs is missing on my machine. I reinstall rpm-libs then everything is ok. Note: After installing rpm-libs, if the problem still exists, please try "rpm -v --rebuilddb --define="_rpmlock_path /var/lock/rpm"".
seems to me as though there is most likely a problem with your RPM database. Have you removed or modified it in any way lately? I'd start with the Fedora documentation that explains how to rebuild the database.

What does "The APR based Apache Tomcat Native library was not found" mean?

I am using Tomcat 7 in Eclipse on Windows. When starting Tomcat, I am getting the following info message:
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
What does this mean and how can I provide the APR library?
It means exactly what it says: "The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path"
The library referred to is bundled into an OS specific dll (tcnative-1.dll) loaded via JNI. It allows tomcat to use OS functionalities not provided in the Java Runtime (such as sendfile, epoll, OpenSSL, system status, etc.). Tomcat will run just fine without it, but for some use cases, it will be faster with the native libraries.
If you really want it, download the tcnative-1.dll (or libtcnative.so for Linux) and put it in the bin folder, and add a system property to the launch configuration of the tomcat server in eclipse.
-Djava.library.path=c:\dev\tomcat\bin
Unless you're running a production server, don't worry about this message. This is a library which is used to improve performance (on production systems). From Apache Portable Runtime (APR) based Native library for Tomcat:
Tomcat can use the Apache Portable Runtime to provide superior
scalability, performance, and better integration with native server
technologies. The Apache Portable Runtime is a highly portable library
that is at the heart of Apache HTTP Server 2.x. APR has many uses,
including access to advanced IO functionality (such as sendfile, epoll
and OpenSSL), OS level functionality (random number generation, system
status, etc), and native process handling (shared memory, NT pipes and
Unix sockets).
On RHEL Linux just issue:
yum install tomcat-native.x86_64
/Note:depending on Your architecture 64bit or 32bit package may have different extension/
That is all. After that You will find in the log file next informational message:
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
All operations will be noticeably faster than before.
Installation the native library on Ubuntu server with:
sudo apt-get install libtcnative-1
If that does not work tomcat-native needs to be installed
Install Oracle java7:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java7-set-default
Install tomcat apr:
wget http://apache.mirror.anlx.net//apr/apr-1.5.0.tar.gz
tar zxvf apr-1.5.0.tar.gz
rm apr-1.5.0.tar.gz
cd apr-1.5.0
sudo ./configure
sudo make
sudo make install
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
Install tomcat tomcat-native:
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org//tomcat/tomcat-connectors/native/1.1.29/source/tomcat-native-1.1.29-src.tar.gz
tar zxvf tomcat-native-1.1.29-src.tar.gz
rm tomcat-native-1.1.29-src.tar.gz
cd tomcat-native-1.1.29-src/jni/native
JAVA_HOME=/usr/lib/jvm/java-7-oracle
sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
sudo make
sudo make install
I just went through this and configured it with the following:
Ubuntu 16.04
Tomcat 8.5.9
Apache2.4.25
APR 1.5.2
Tomcat-native 1.2.10
Java 8
These are the steps i used based on the older posts here:
Install package
sudo apt-get update
sudo apt-get install libtcnative-1
Verify these packages are installed
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install openssl
Install package
sudo apt-get install libssl-dev
Install and compile Apache APR
cd /opt/tomcat/bin
sudo wget http://apache.mirror.anlx.net//apr/apr-1.5.2.tar.gz
sudo tar -xzvf apr-1.5.2.tar.gz
cd apr-1.5.2
sudo ./configure
sudo make
sudo make install
verify installation
cd /usr/local/apr/lib/
ls
you should see the compiled file as
libapr-1.la
Download and install Tomcat Native source package
cd /opt/tomcat/bin
sudo wget https://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.2.10/source/tomcat-native-1.2.10-src.tar.gz
sudo tar -xzvf tomcat-native-1.2.10-src.tar.gz
cd tomcat-native-1.2.10-src/native
verify JAVA_HOME
sudo pico ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
source ~/.bashrc
sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
sudo make
sudo make install
Edit the /opt/tomcat/bin/setenv.sh file with following line:
sudo pico /opt/tomcat/bin/setenv.sh
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
restart tomcat
sudo service tomcat restart
On Mac OS X:
$ brew install tomcat-native
==> tomcat-native
In order for tomcat's APR lifecycle listener to find this library, you'll
need to add it to java.library.path. This can be done by adding this line
to $CATALINA_HOME/bin/setenv.sh
CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/local/opt/tomcat-native/lib"
If $CATALINA_HOME/bin/setenv.sh doesn't exist, create it and make it executable.
Then add it to the eclipse's tomcat arguments (double-click Server > Open Launch Configuration > Arguments tab > VM arguments)
-Djava.library.path=/usr/local/opt/tomcat-native/lib
on debian 8 I fix it with installing libapr1-dev:
apt-get install libtcnative-1 libapr1-dev
Had this problem as well. If you do have the libraries, but still have this error, it may be a configuration error. Your server.xml may be missing the following line:
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
(Alternatively, it may be commented out). This <Listener>, like other listeners is a child of the top-level <Server>.
Without the <Listener> line, there's no attempt to load the APR library, so LD_LIBRARY_PATH and -Djava.library.path= settings are ignored.
I had this issue upgrading from Java 8 to 11. After adding this dependency, my app launched without issue:
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
I had the same problem when tomсat could not find the class. Try to view other log files. Sometimes No class def found error appears in different log files:
tomcat8-stdout
tomcat8-stderr
localhost
If you don't have Tomcat Native library install it with:
sudo apt-get install libtcnative-1
and if it's still there an old version upgrade it with:
sudo apt-get upgrade libtcnative-1
My problem was in add some library from tomcat to eclipse class path i just going to
eclipse click right to project and going to debug configuration -> classpath -> Add External JARs add all jars files from apache-tomcat-7.0.35\bin this was my problem and it's worked for me .
For future readers:
I had faced this issue myself when trying to run a Spring Boot application in Spring STS. This issue didn't resurface initially. I was able to work on my project without any issues for quite some time until one fine day I started getting this particular error.
From what I am able to recall I had not made any configuration changes to my project and neither changed the Java/Tomcat version being used.
None of the discussions/suggestions regarding installing the tomcat native library made any sense to me since the project was already working fine before.
SOLUTION that worked for me:
So lastly I though of trying to delete and reimport my project.
I deleted my project from Spring STS, restarted the Spring STS and then reimported the project. It worked like a charm and never faced the issue ever since.
You may also try deleting any IDE generated files/folders(if there are any) in your project, before restarting the IDE and reimporting the project.
I still happen to work on this project from time to time and haven't faced the issue as of now. My current development IDE is IntelliJ.
I'm not sure if the error was IDE specific.

netbeans installation error: can't initialize ui running in headless mode

I'm trying to install NetBeans on Linux Mint, and I'm getting the following error every time I run the installation script:
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
Can`t initialize UI
Running in headless mode
What should I do to get it working?
In case anyone has this problem in the future, Netbeans doesn't like OpenJDK 6 but -- fortunately -- it works fine with OpenJDK 7 (as expected as for Java 7 OpenJDK is the reference implementation). Just make sure you remove any Java 6 packages before installation attempts. On Ubuntu and Mint one can do:
sudo apt-get purge ^openjdk-6-*
sudo apt-get install openjdk-7-jdk
It should work afterwards.
Looks like Netbeans does not work properly with Openjdk. This is what I did (in Linux Mint 12):
sudo apt-get remove openjdk*
sudo apt-get install sun-java6-jdk
Then you will be able to run the .sh installer as usual.
I hit this same issue on Kubuntu 12.04 LTS but needed Sun JDK 6 for a project I'm maintaining. I stumbled upon Martin Wimpress' OAB-Java script (by way of help.ubuntu.com) which creates and installs a local apt repository for Sun JDK 6. You can find the latest instructions on Martin's github site which run as follows:
cd ~/
wget https://github.com/flexiondotorg/oab-java6/raw/0.2.7/oab-java.sh \
-O oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh
If you want to see what this script is doing while it is running then execute the following from another shell:
tail -f ./oab-java.sh.log
Alternatively, you can clone the OAB-Java repo and kick of the script from within it:
git clone git://github.com/flexiondotorg/oab-java6.git
cd oab-java6
sudo ./oab-java.sh
Either way, once that is in place follow Jose's instructions to remove openjdk and install sun jdk:
sudo apt-get remove openjdk*
sudo apt-get install sun-java6-jdk
One final note, the script accepts a -7 argument which will create and install a local apt repository for Oracle JDK 7 should you want to go that route.
I was able to get it to work by getting into the target system using ssh -X, then making sure DISPLAY was exported. That handles the X server issues.
Change the priority of the Oracle Java executables:
export PATH=/usr/java/latest/bin:$PATH
Run the installer:
./netbeans-8.1-linux.sh
What worked for me was installing default java environment from the terminal:
sudo apt-get install default-jre
The installation was a success - under "user".
The installation failed - under "su" (under Red Hat equivalent of "sudo"). With
Can`t initialize UI
Running in headless mode
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
For me.

Why can't I install DBD::mysql so I can use it with Maatkit?

I'm trying to install Maatkit following the maatkit instructions. I can't get past having to install DBD::mysql. "Warning: prerequisite DBD::mysql 1 not found."
When I try to install DBD::mysql from cpan, I get very helpful "make had returned bad status, install seems impossible".
Perl is "v5.8.8 built for darwin-thread-multi-2level", the one that came with OS X. I also tried building from source with same result.
We need more of the error message. Most likely, you are missing the MySQL client development files. I don't know how to install these on OSX. Also see this older post on OSX 10.5.2 , in which some other failures with the mysql client libraries are found.
Possibly post this question with more parts of your error message at perlmonks.org, if stackoverflow doesn't allow for convenient pasting of your make session or rather the last 20 or 10 lines of it.
Some more Googling with site:perlmonks.org also finds this post which has some more details on things to watch out for when installing DBD::MySQL. Depending on how comfortable you feel with the installation, you might want to manually run the tests, supplying a test database and test user or even skip testing the module.
After a bit more googling, this worked for me:
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
sudo ln -s /usr/local/mysql/include /usr/local/mysql/include/mysql
sudo perl -MCPAN -e 'install Bundle::DBD::mysql'
press enter a bunch of times, then in your maatkit folder:
perl Makefile.PL
sudo make install
and you'll find the mk-* programs in /usr/local/bin/
You will want to install MySQL first. I usually use the binary packages they provide for OS X. The packages do include the headers and MySQL client libraries which DBD::MySQL requires. Once the MySQL package is installed, DBD::MySQL should install without issue.
Here is my output:
$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite DBD::mysql 1 not found.
Writing Makefile for maatkit
$ mysql --version
mysql Ver 14.12 Distrib 5.0.51b, for apple-darwin9.0.0b5 (i686) using readline 5.0
I notice that there are in effect DBD::MySQL packages in the fink repositories. For example:
ayaz#ayazs-macbook$ fink list | grep -i 'dbd-mysql'
dbd-mysql-pm586 3.0008-10 Perl5 Database Interface to MySQL
dbd-mysql-pm588 3.0008-10 Perl5 Database Interface to MySQL
Perhaps installing through fink one of those packages may help alleviate your troubles.
Also, and I cannot be certain of this, you may want to install for MySQL-5.x (if you have that version installed) the mysql15-dev and mysql15-shlibs packages. I installed those through fink thus:
$ sudo fink --use-binary-dist install mysql15-dev