apt upgrade dpkg error wile processing (Segmentation fault)..? - dpkg

I was updating packages in raspberry pi and when I apt upgraded this error message came out.
dpkg: error processing archive /var/cache/apt/archives/bash_5.1-2+b1_armhf.deb (--unpack): new bash package pre-installation script subprocess was killed by signal (Segmentation fault) update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode Errors were encountered while processing: /var/cache/apt/archives/bash_5.1-2+b1_armhf.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried some error fixing with
dpkg -i --force-overwrite /var/cache/apt/archives/bash_5.1-2+b1_armhf.deb
but I failed.

The bash preinst maintainer script is a compiled program (instead of the usual shell scripts used there), to avoid having to depend on bash being present at all before it as been unpacked for the first time.
In your case it appears that program is segfaulting for some reason, so it's buggy and needs be debugged and tracked down. Your best option is to report this to the distribution you are using, ideally by providing a core file or a backtrace of the segfault.

Related

Received Linux "Error: BrokenCount > 0" after trying to fix mysql install?

I tried fixing a mysql install after getting error codes. I tried removing then reinstalling. I tried installing mariadb and removing. Then tried again. Eventually something happened and got "Error: BrokenCount > 0". So the package manager is broken. I tried sudo apt -f install and I get the following messages in the terminal.
user#linux:~$ sudo apt -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:
galera-3 libconfig-inifiles-perl libdbi-perl libreadline5 socat
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mysql-server-8.0
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-8.0
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/1,329 kB of archives.
After this operation, 1,536 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 218690 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.26-0ubuntu0.20.04.3_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.26-0
ubuntu0.20.04.3_amd64.deb (--unpack):
new mysql-server-8.0 package pre-installation script subprocess returned error
exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.26-0ubuntu0.20.04.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Assistance with this problem would be appreciated.
I used the following two posts to resolve my problem.
mysql.service is missing but shows up on list - fails install
https://askubuntu.com/questions/1012223/0-upgraded-0-newly-installed-0-to-remove-and-0-not-upgraded-1-not-fully-insta

apt-get install error while processing vsftpd: cannot create directory

I receive the following error when using RVM to install ruby with rvm install 2.3.0. This is from the log file RVM produces.
Setting up vsftpd (3.0.3-8+b1) ...
vsftpd user (ftp) already exists, doing nothing.
mkdir: cannot create directory ‘/srv/ftp’: Permission denied
dpkg: error processing package vsftpd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
vsftpd
E: Sub-process /usr/bin/dpkg returned an error code (1)
Infact, anytime I run an apt-get install command I always get this warning about vsftpd. I have always just ignored it as packages install just fine. The main problem now is that RVM is now picking up on this error as being critical so it stops installing Ruby.
The problem is that the folder /srv/ftp physically can not be created even by root (or at least I don't know how to). The way my server is set up is that the /srv/ folder only exists to mount external disk drives so I can't create an arbitrary folder here.
E.g. datadisk01 would be mounted onto /srv/datadisk01
Is there a way to change where vsftpd creates this ftp folder to a different location so it will run properly? OR is there a way I can force RVM to ignore this error message?
I would prefer the answer that fixes the error but my main objective is just to get Ruby installed.
I have already tried removing vsftpd with apt-get but it still persists.

Raspberry dpkg "files list file for package '<pck_name>' missing AND cannot allocate memory

I have the following issue:
when I try to
apt-get upgrade
I receive some dpkg warning, (picture attached).
dpkg: warning: files list file for package 'php5-json' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-readline' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-cli' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5-common' missing; assuming package has no files currently installed
dpkg: unrecoverable fatal error, aborting:
failed to allocate memory: cannot allocate memory
E: Sub-process /usr/bin/dpkg returned an error code (2)
This happens also when I try to install these singles packages, and when I try to remove them. I also tried without success to remove the whole apache2 and php5 packages. Either apt-get autoremove and autoclean followed by update and upgrade does not change the outcome.
I have some free space on SD card, and I tried some proposed solutions to similar issues:
Tried to manually delete .deb files in /var/cache/apt/archives/ as explained here
Tried to force reinstallation as explained here
Also tried a bunch of similar solutions, without success...
Please, can someone point me in the right direction? This problem leads to an error launching apache2, and I can't use my websites.
Thank you!
Try sudo apt-get install -f to fix your dependencies
Also sudo dpkg --configure -a to fix your installations

phpMyAdmin - Error The json extension is missing

I have installed on Ubuntu PHP, MySQL, apache and phpmyadmin. When I try to open via browser phpmyadmin I got this error
phpMyAdmin - Error
The json extension is missing. Please check your PHP configuration.
There are a lot of similar thread and I have tried a lot of solutions provided in them but none is helped me to fix this issue. Firstly I tried to install this extension like sudo apt-get install php5-json and this is the result
sudo apt-get install php5-json
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-json is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up javascript-common (11) ...
dpkg: error processing package javascript-common (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
javascript-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
So obviously I have the latest version of php5-json - php5-json is already the newest version.
This is my version of Ubuntu
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
But I have no idea how to fix the error?
Check last message from this link: Ubuntu Forum Thread: dpkg: javascript-common error
Next install "javascript-common" package, next json package.

sudo apt-get install xvfb

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libruby1.8
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
xserver-common
The following NEW packages will be installed:
xvfb
The following packages will be upgraded:
xserver-common
1 upgraded, 1 newly installed, 0 to remove and 308 not upgraded.
1 not fully installed or removed.
Need to get 0 B/899 kB of archives.
After this operation, 2,068 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up apt (0.8.16~exp5ubuntu13.2) ...
gpg: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
gpg: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP
dpkg: error processing apt (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
apt
E: Sub-process /usr/bin/dpkg returned an error code (1)
Why I cannot install xvfb?
Get your admin to run this:
su
mkdir temp
mv /usr/local/lib/libreadline* temp
ldconfig
apt-get update
Then run your apt-get again
It seems the package xvfb uses the command "gpg" in the post install script. The gpg command seems to depend on libreadline, which does not seem to be compatible with gpg.
This is really strange. Usually a Debian/Ubuntu system does not install anything under /usr/local and the dependencies are in order. Could it be you have yourself installed libreadline into /usr/local/lib?
Ask the package manager which package owns the file /usr/local/lib/libreadline.so.6:
dpkg -S /usr/local/lib/libreadline.so.6
If it tells you a package where the file belongs, try to remove that package with
dpkg -P packagename
If no package owns it, remove the file.
If you want to keep /usr/local/lib/libreadline.so.6 and still have a working system, you should prevent programs from using it unless explicitly told to do so. You have probably modified the dynamic linker configuration in /etc/ld.so.conf. Undo those changes to get back to a working system.