Category Archives: Troubleshooting

Solution for unmet dependencies or broken packages while installing Wine32 on Ubuntu Eoan 19.10


(adsbygoogle = window.adsbygoogle || []).push({});

I’ve faced this problem several times, where it is not possible to install 32 bit Wine on Ubuntu (and possibly Debian). In each case, the problem has been packages installed from Ondrej Sury’s repository (for installing php7 in my case). It may be a different repository in your case, but the reason could be the same – it did not install 32 bit packages.

How to know if this is the problem you are facing as well.

Try to install 32 bit Wine. It is better to use the official repository, so:

sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main'
sudo apt update
sudo apt install --install-recommends winehq-staging

Or you can simply add from the available repositories. Which one is not the issue, but if the packages are broken, you will not be able to install 32 bit Wine using any of the methods. It isn’t helpful that usual methods to fix it like “apt install -f” don’t show broken packages. The packages aren’t broken unless you need to install the equivalent i386 versions.

Then this happens.

$sudo # apt install wine32
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 wine32:i386 : Depends: libwine:i386 (= 4.0.2-1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Oops!

If you try to install the unmet dependencies by adding them to the install line (don’t reply “Y” to any of the installs, just dig into the dependencies) you get:

$ sudo apt -f install wine32 libwine:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libwine:i386 : Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not going to be installed
                Depends: libgphoto2-6:i386 (>= 2.5.10) but it is not going to be installed
                Depends: libgstreamer-plugins-base1.0-0:i386 (>= 1.0.0) but it is not going to be installed
                Depends: libgstreamer1.0-0:i386 (>= 1.4.0) but it is not going to be installed
                Depends: libldap-2.4-2:i386 (>= 2.4.7) but it is not going to be installed
                Depends: libxml2:i386 (>= 2.9.0) but it is not going to be installed
                Recommends: libcups2:i386 (>= 1.4.0) but it is not going to be installed
                Recommends: libgnutls30:i386 (>= 3.6.5) but it is not going to be installed
                Recommends: libgssapi-krb5-2:i386 (>= 1.6.dfsg.2) but it is not going to be installed
                Recommends: libkrb5-3:i386 (>= 1.6.dfsg.2) but it is not going to be installed
                Recommends: libxslt1.1:i386 (>= 1.1.25) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Keep adding the packages to the install (I’ll spare you the boring details) to discover more dependencies. And so on, till you get lines about broken packages like so:

 libpcre2-8-0 : Breaks: libpcre2-8-0:i386 (!= 10.34-7+ubuntu19.10.1+deb.sury.org+1) but 10.32-5 is to be installed
 libpcre2-8-0:i386 : Breaks: libpcre2-8-0 (!= 10.32-5) but 10.34-7+ubuntu19.10.1+deb.sury.org+1 is to be installed
 libpcre3 : Breaks: libpcre3:i386 (!= 2:8.43-1+ubuntu19.10.1+deb.sury.org+1) but 2:8.39-12 is to be installed
 libpcre3:i386 : Breaks: libpcre3 (!= 2:8.39-12) but 2:8.43-1+ubuntu19.10.1+deb.sury.org+1 is to be installed

This gives you a hint of the problem. The packages with deb.sury.org are the ones from Ondrej Sury’s repository. I had forgotten I had installed them, some upgrade since had removed the ppa as well. But they were the culprit. I suppose you could add the ppa again (your repository may differ).

$ sudo add-apt-repository ppa:ondrej/php

It is best you do this regardless of whether you plan to use the repository or downgrade the packages to the default ones in Ubuntu repositories. I didn’t need the repository anymore, so I downgraded the packages. There are many methods, but my idiot-proof preference is the ppa-purge package. It downgrades the packages without me needing to know too much about the process.

$ sudo apt install ppa-purge
$ sudo  ppa-purge  ppa:ondrej/php

Now, if you try to install wine32, it should work.

Note: I am at best a copy-paste hacker with some aptitude for extrapolating hacks to new situations. This is not a recommendation of best practices or anything. This blog mostly covers problems I face and their fixes, so that the next time I face them, I can refer to what made sense to me before and get things working faster.

Note1: But this did work for me.


(adsbygoogle = window.adsbygoogle || []).push({});

Quick fix for curl: symbol lookup error: /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined symbol

So you’re trying to install something or compile something or you have curl installed, but it won’t work, because….

# curl -V
curl: symbol lookup error: /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined symbol: nghttp2_http2_strerror

Or it may be some other package doing this. If you land up on this obscure blog searching, chances are you already have been pulling your hair out wondering what to do.

Here is what I finally did in order to be able to get on with life. Please note, I am not a programmer or any kind of expert and do this at your own risk. I have no idea what you may break. In my case, it was a package I was fairly certain doesn’t belong on my system and isn’t installed.milfster.org comic xxx

Anyway, without further ado, here’s the magic pill.

# ldd /usr/bin/curl|grep /usr/local
	libnghttp2.so.14 => /usr/local/lib/libnghttp2.so.14 (0x00007f8a763ca000)
# mv /usr/local/lib/libnghttp2.so.14 /usr/local/lib/libnghttp2.so.14.bak
# curl -V
curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 

aaaand… we’re in business. As you clearly see, it is going to be suicidal if you rename something important. So like I said, no guarantees here. It is probably not the correct way of dealing with this, but I am beyond the point of correct now, and this works.

What I have basically done is checked the file referring to the non-existing package causing the problem and renamed it. I imagine you could move or delete it, but if you delete, and this doesn’t work, you can’t bring it back.

Final tip: If you’re using php-curl (or php7.0-curl) with Nginx, you’re still going to be haunted by the problem you have fixed unless… you restart php-fpm 🙂

#service php7.0-fpm restart

Now really done.

How to fix mixed content warning if page loads insecure content in spite of #WordPressHTTPS? #W3TC

So I had been confounded. I used to have a sweet green securely loaded blog for ages and I didn’t know what I had changed to make it start throwing up mixed content warnings. I didn’t recall changing ANYTHING on the blog at all. Yet, when pages were accessed over https, they loaded assets over http – in spite of WordPress HTTPS being active.

The problem turned out to be W3TC Disk Enhanced page caching. It does not seem to distinguish between http and https versions of the page, resulting in the https version of the page serving the http page – of course, with assets loaded over http.

I used to redirect the non ssl version of the blog to the ssl version, but for some reason, I decided to only use an HSTS header. Since the blog automatically loaded over https, I did not anticipate problems. However, the site being available over http apparently caused enough traffic (that ignored HSTS or was not capable?) to create cached pages that became a nuisance.

Mixed content warnings on assets loaded by wordpress

Two ways to fix this. I chose the easy one first. Redirected my non-ssl site to ssl. Done.

All content loaded securely by WordPress

If this results in any noticeable drop of traffic or complaints from anyone who needs to use it without ssl for any believable reason, I will choose method two: relying on HSTS alone again and using either the disk basic or opcode cache for page caching instead of “page enhanced” – this ought to work.

You can check your website on whynopadlock.com to identify the exact assets loaded that are giving mixed content errors.

Ubuntu 13.10 internet very slow “nothing helps” fix

I installed Ubuntu 13.10 on my laptop and went nuts with the laggy laptop. I have 2gb memory on it, which shouldn’t be causing such a comatose experience. I installed drivers, tweaked memory, did a hundred things, nothing helped.

Digging around in the innards, I found that /etc/resolv.conf was very strange and was showing localhost as the name server. This couldn’t be right. Digging around, I found that any attempt to put working DNS servers was getting rewritten.

In the end, I found a strange fix. Network Manager configuration (sudo gedit /etc/NetworkManager/NetworkManager.conf)was using dns from dnsmasq. Guessing (rightly as it turns out) that I didn’t need dns served from my computer (and i have no idea how it would sync it), I commented out that line and restarted network manager. It looks like this.

<code>dns=dnsmasq</code>

Commented it out like so

<code>#dns=dnsmasq</code>

Now /etc/resolv.conf is showing the DNS servers it gets from the internet provider.

I have no idea if this is the “right answer”, but if your computer is slow and freezing on using internet, and your /etc/resolv.conf is showing 127.0.1.1 or 127.0.0.1 or something as your dns server instead of proper dns server IPs, it is worth a shot. You can always uncomment it if it doesn’t help.

My computer is running faster, freezing less and hasn’t yet exploded.

Ioncube with Nginx+php-fpm giving 502 gateway error SOLVED

Ubuntu 13.10 seems to be having trouble with ioncube and php-fpm. My earlier guide on loading ioncube may not work for you anymore.

This is really strange and I have no idea why no one seems to mention it, but if you are getting frustrated trying to install the ioncube loader on php-fpm, just ignore the instructions to create the 20-ioncube.ini file, and plug the line directly into the end of your php ini.

Steps to install ioncube loader with php5-fpm

cd /usr/local
sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
mv /usr/local/ioncube/* /usr/lib/php5/20121212/

This is the same.

Now, instead of creating a file called 20-ioncube.ini or ioncube.ini directly add it to your php.ini file (On Ubuntu with a repository installed php5-fpm package, php.ini will be found at /etc/php5/fpm/php.ini)

At the very end add:

zend_extension = /usr/lib/php5/20121212/ioncube_loader_lin_5.5.so

Then restart php-fpm

service php5-fpm restart

If it still doesn’t work, try doing the same thing as root.

If you can’t find your php.ini, create a php file on your website with some random name. Open it in an editor and add the line:

Access the file on your site with a browser. It will have all kinds of info about php, including the configuration files (php.ini and others) locations.

Meteor::Socket bind: Address already in use at Meteor/Socket.pm line 115.

If, after installing meteor server, you get an error like

Meteor::Socket bind: Address already in use at Meteor/Socket.pm line 115.

when trying to start it up with ./meteord -d or /etc/init.d/meteord start, it means that you likely have another instance of meteor running.

Unless you have changed ports around, you can kill the exising instance of meteor with pkill meteor or simply use it without starting a new one 😉

PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

If you are trying to upgrade, and suddenly start getting errors like:

Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

Here are some things to check.

  • This basically means that WordPress is not able to unzip the downloaded packages to install the upgrades.
  • Check to see available space on your disk. If your disk is full you should try upgrading your hosting package or freeing up some space on the disk. One easy way might be to delete old image thumbnails in sizes you no longer use.
  • If you have enough space on your disk, it may be that specific downloaded packages may be problematic. Try to install a plugin you don’t have, and if that works, you should check to see if there is a mysterious folder called “Upgrades” [DO NOT CONFUSE WITH UPLOADS]. If this folder exists, it is worth deleting it to see ii that lets  you do the upgrade.
Enhanced by Zemanta

Fix: Realtek SD card reader not working with Ubuntu

I have a RTS5209 Realtek SD card reader on my laptop, which was not reading any card inserted. The following instructions are likely to work for other versions like RTS5229 or RTS5289 as well.

Turns out I needed to install the driver.

Realtek offers drivers on its website for Ubuntu/Linux. Download the driver and unpack into a temporary directory.

Open a terminal and cd into the directory you unpacked the file.

Then enter one after the other:

make

sudo make install

sudo depmod

You will have to reboot your computer for the driver to load, or you can enter this command:
sudo modprobe rts_pstor

This is for RTS5209. I believe for RTS5229 it is (hint:read folder name):
sudo modprobe rts5229

However, this only works on older kernels and on 3.9+ you get errors like:

vidyut@vidyut-Compaq-435-Notebook-PC:~/tmp/rts_pstor$ make
sed "s/RTSX_MK_TIME/`date +%y.%m.%d.%H.%M`/" timestamp.in > timestamp.h
cp -f ./define.release ./define.h
make -C /lib/modules/3.8.0-26-generic/build/ SUBDIRS=/home/vidyut/tmp/rts_pstor modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-26-generic'
CC [M] /home/vidyut/tmp/rts_pstor/rtsx.o
/home/vidyut/tmp/rts_pstor/rtsx.c:916:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
/home/vidyut/tmp/rts_pstor/rtsx.c:1080:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
/home/vidyut/tmp/rts_pstor/rtsx.c:1106:11: error: ‘rtsx_probe’ undeclared here (not in a function)
/home/vidyut/tmp/rts_pstor/rtsx.c:1107:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/home/vidyut/tmp/rts_pstor/rtsx.c:1107:24: error: ‘rtsx_remove’ undeclared here (not in a function)
/home/vidyut/tmp/rts_pstor/rtsx.c:485:12: warning: ‘rtsx_control_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:596:12: warning: ‘rtsx_polling_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:745:13: warning: ‘quiesce_and_remove_host’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:780:13: warning: ‘release_everything’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:790:12: warning: ‘rtsx_scan_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:816:13: warning: ‘rtsx_init_options’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/home/vidyut/tmp/rts_pstor/rtsx.o] Error 1
make[1]: *** [_module_/home/vidyut/tmp/rts_pstor] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-26-generic'
make: *** [default] Error 2
vidyut@vidyut-Compaq-435-Notebook-PC:~/tmp/rts_pstor$

The fix for this is to edit the file rtsx.c (that is throwing the errors) and remove “__devinit” “__devexit” and “__devexit_p” from it, leaving the rest of the code (and the rest of the line they occur in) in tact.

Like so:

static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)

Becomes:

static int rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)

static void __devexit rtsx_remove(struct pci_dev *pci)

Becomes:
static void rtsx_remove(struct pci_dev *pci)

.remove = __devexit_p(rtsx_remove),

Becomes:
.remove = rtsx_remove,

Now, when you run make, the process should complete without errors.

If your SD card *still* doesn’t mount, check your dmesg like so:

sudo dmesg

If it shows something like:
[ 694.058432] systemd-hostnamed[2516]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!

Try installing the library.
apt-get install libnss-myhostname

If it still doesn’t work, I don’t know what to do. This SHOULD work.

Nginx: upstream timed out (110: Connection timed out)

Error 110: Connection timed out while reading response header from upstream

Sometimes a Nginx web server seems to load pages with php code with a lot of xml parsing really slowly. Often it doesn’t load or connection times out. This will be seen more on pages where the php code parses through large xml files and outputs data only when all the parsing is complete. The Nginx web server times out before php returns output.

We have to make the Nginx web server wait more before giving up on the upstream.

This is a typical error I get:

upstream timed out (110: Connection timed out) while reading response header from upstream

or

connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream

and such. The second one is inexplicable, since everything is working when not timing out, but I have often seen these two together.

The fix that works is increasing the timeout.

In the server configuration /etc/nginx/nginx.conf on Ubuntu/Debian, in the http {....} block, add the line (or edit the commented out line)
fastcgi_read_timeout 300s;

Restart the Nginx web server (as root or with sudo).
service nginx restart

There should be an immediate improvement when parsing large xml files. If you are still having problems, raise the number till resolved.

English: Nginx Logo Español: Logo de Nginx

English: Nginx web server Logo Español: Logo de Nginx (Photo credit: Wikipedia)

Enhanced by Zemanta

Update/install fail: Server cannot access software repositories

If you are trying to install something and the server waits forever after you answer yes to the update and it accesses the software repository… something like…

apt-get update
...
details of packages
...
Need to get 83.7 MB of archives.
After this operation, 237 kB disk space will be freed.
Do you want to continue [Y/n]?
0% [Connecting to archive.ubuntu.com]

And then nothing. It fails.

Do you have UFW installed? UFW can block outgoing connections from your server, so it becomes unable to access the software repositories. Rather than make exceptions, it is easier to disable the firewall and enable again when update or install is done.
??
If you have UFW (Uncomplicated Firewall) installed, disable it and try again.

ufw disable

Now your upgrades should work. Once you are done, re-enable your firewall.

ufw enable
Enhanced by Zemanta