Sub-process /usr/bin/dpkg returned an error code (1)- ubuntu - apache

I am trying to install apache:
sudo apt-get install apache2
And i am getting this error:
Setting up google-cloud-sdk (132.0.0-0) ... dpkg: error processing
package google-cloud-sdk (--configure): subprocess installed
post-installation script returned error exit status 1 Errors were
encountered while processing: google-cloud-sdk E: Sub-process
/usr/bin/dpkg returned an error code (1)
Similarly i get th following output when i run sudo dpkg --configure -a:
Setting up google-cloud-sdk (132.0.0-0) ...
dpkg: error processing package google-cloud-sdk (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
google-cloud-sdk
How can i solve this?

Fairly crude solution and might ignore an actual problem, but you can skip the post installation script by putting
exit 0
in the 2nd line of the file
/var/lib/dpkg/info/google-cloud-sdk.postinst
Then rerun
dpkg --configure -a

If you failed to install Java and find this error then use this following instruction:
~$ java -version
~$ javac
checking list
~$ sudo dpkg --list | grep -i jdk
remove java (put your install version e.g. java8)
~$ sudo apt-get purge oracle-java9-installer
then again checking list
~$ sudo dpkg --list | grep -i jdk
For stopping failed download packages:
checking list
~$ sudo dpkg --list | grep -i pakage_name
remove package
~$ sudo apt-get purge package_name
then again checking list
~$ sudo dpkg --list | grep -i package_name

Related

how to correctly install wkhtmltopdf in linux mint?

IM trying to install "wkhtmltopdf"
sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb
when I try to run I get this command
E: Unsupported file ./wkhtmltox_0.12.6-1.bionic_amd64.deb given on commandline
can anyone show me how to fix this?
Use
# sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
# sudo apt install -f
The last command should install any missing dependencies when running the first command.

Install yarn and npm in WSL

I have installed Windows Subsystem for Linux (WSL) and Ubuntu 16.04 on my Windows 10. Then I followed this to install yarn:
sudo apt update
sudo apt install curl
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
It did not raise any error. However, yarn --version returned
$ yarn --version
/mnt/c/Users/chengtie/AppData/Roaming/npm/yarn: 12: /mnt/c/Users/chengtie/AppData/Roaming/npm/yarn: node: not found
npm --version returned
$ npm --version
: not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm:
/mnt/c/Program Files/nodejs/npm: 6: /mnt/c/Program Files/nodejs/npm: Syntax error: word unexpected (expecting "in")
Does anyone know how to fix this?
Look at this:
/mnt/c/Users/chengtie/AppData/Roaming/npm/yarn: 12
It is looking for the yarn installed on Windows. You must or uninstall yarn from windows or remove it from the WSL's PATH.
Use the following to remove windows yarn from the PATH:
WIN_YARN_PATH="\$(dirname "\$(which yarn)")"
export PATH=\$(echo "\${PATH}" | sed -e "s#\${WIN_YARN_PATH}##")
You can add this to your .bashrc
Also, look at your error messages it is getting also npm from windows, you need to remove them from the path using the same technique.
You need to type:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
then:
sudo apt-get install -y nodejs
You must install nodejs before
sudo apt-get install nodejs
If you have latest nodejs version installed:
I encountered the same issue and it got fixed by trying sudo npm -v and to get npm without sudo, I restarted the WSL.
If you don't have the latest nodejs version:
If you are on WSL, you can install the Latest stable version by
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
In place of setup_8.x you can keep setup_16.x for version 16 (which includes npm).
sudo apt-get install nodejs
check nodejs version by nodejs -v.
check npm version by npm -v.
If still the same error codes. try sudo npm -v or restart PC/ WSL then try npm -v.

apt --fix-broken install does not work, package manager broken after installing wine-stable

after uninstalling old version of wine-1.8 and installing it again, I encountered an ERROR in package manager for Broken packages:
Preparing to unpack .../libwine_3.0-1ubuntu1_amd64.deb ...
Unpacking libwine:amd64 (3.0-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libwine_3.0-1ubuntu1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/wine/acledit.dll.so', which is also in package wine1.8-amd64 1:1.8.0-0ubuntu1~ubuntu15.10.1~ppa1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libwine_3.0-1ubuntu1_i386.deb ...
Unpacking libwine:i386 (3.0-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libwine_3.0-1ubuntu1_i386.deb (--unpack):
trying to overwrite '/usr/lib/i386-linux-gnu/wine/acledit.dll.so', which is also in package wine1.8-i386:i386 1:1.8.0-0ubuntu1~ubuntu15.10.1~ppa1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libwine_3.0-1ubuntu1_amd64.deb
/var/cache/apt/archives/libwine_3.0-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I SOLVED this problem with the following solution:
sudo dpkg --force depends -P wine1.8-i386
sudo dpkg --force depends -P wine1.8
sudo dpkg --force depends -P wine1.8-amd64
and finally you need to run this command to fix all broken packages:
sudo apt --fix-broken install
(for more reference check this out.)

pip install matplotlib fails: 'cannot build package freetype; "python setup.py egg_info" failed with error code 1'

I want to use matplotlib.pyplot. I can't because
altoidnerd#LEPTON:~/ $ pip install matplotlib
is failing on ubuntu 14 giving an egg_info error, and warning "cannot build package freetype"
* The following required packages can not be built:
* freetype
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8UvQcW/matplotlib
But
altoidnerd#LEPTON:~/$ dpkg -L libfreetype6
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libfreetype.so.6.11.1
/usr/share
/usr/share/doc
/usr/share/doc/libfreetype6
/usr/share/doc/libfreetype6/FTL.TXT.gz
/usr/share/doc/libfreetype6/ft2faq.html
/usr/share/doc/libfreetype6/TODO
/usr/share/doc/libfreetype6/copyright
/usr/share/doc/libfreetype6/changelog.Debian.gz
/usr/share/doc/libfreetype6/pcf
/usr/share/doc/libfreetype6/pcf/README
/usr/lib/x86_64-linux-gnu/libfreetype.so.6
my debug.log is here: http://pastebin.com/rvDuYDiy
A discussion about this on github was closed last year, but I was unable to use it to solve the problem (I left a note):
https://github.com/matplotlib/matplotlib/issues/3029
I started a reddit thread too.
This did the trick for me:
sudo apt-get install libfreetype6-dev pkg-config
The following command mentioned in the github thread that you mentioned above works for me:
sudo ln -s /usr/include/freetype2/ft2build.h /usr/include/
I had a similar issue solved by:
easy_install -U pip
pip install matplotlib

ERROR: Unrecognized command line argument: 'pkg' ( see: 'rvm usage' )

I am trying to run
rvm pkg install zlib
and I get the following message
ERROR: Unrecognized command line argument: 'pkg' ( see: 'rvm usage' )
I installed rvm by running:
sudo apt-get install ruby-rvm
I have searched online but I have only found a similar error stating that package
has changed to pkg, but in this case I am using pkg. Any ideas?
I am using Ubuntu 11.10 x64
Thank you in advance
It seems I didn't install rvm as I should.
First uninstall ruby-rvm by running:
$ sudo apt-get --purge remove ruby-rvm
Then install rvm by running:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
like the instructions here