Labels

Linux (39) Thinkpads (4) lego (12) pi (20)

Tuesday, 22 January 2013

Moving to Multiarch on Debian 64bit systems

With updating to Update Pack 6 for LMDE (Linux Mint Debian Edition), which is based on Debian 7 (Wheezy), ia32 is set to be replaced by multiarch (would apply to Ubuntu as well).  Although ia32 isn't removed as part of the upgrade (it is held back), not migrating to multiarch post upgrading to Update Pack 6 will just lead to issues further down the road including in future update packs.

So as part of the post-upgrade activities, on all 64bit systems, I proceeded to migrate to a multiarch install.

As root, perform the following steps:


  1. add i386 architecture
    dpkg --add-architecture i386

  2. update sources.listdd
    sed -i 's/deb\ /deb\ [arch=amd64,i386]\ /g' /etc/apt/sources.list

  3. update

    apt-get update



  4. validate foreign-architecture [should show i386]

  5. dpkg --print-foreign-architectures


  6. remove ia32 and ia32-libs-gtk

    apt-get remove ia32
    apt-get remove ia32-libs-gtk


As part of the move, some of your 32bit software may become uninstalled (such as wine, etc) and will need to be reinstalled after moving to multiarch.  The list of 32bit software that will removed during the process will be identified by apt-get in step 5.

To explicitly install a 32bit library or application (i386 app), append a ":i386" to the library name a such as:

apt-get install library.deb:i386

32bit library dependencies will automatically be installed (if available).  You no longer need to force install or force-architecture (such as dpkg --force-architecture)

AT&T Global Network Client VPN Multiarch 64bit Install

I recently upgraded to Update Pack 6 on LMDE (Linux Mint Debian Edition).  Part of the move to Debian Wheezy (Debian 7) is a move from ia32 to multiarch to handle 32bit libraries on a 64bit system.

During the conversion from ia32 to multiarch was the need to reinstall my 32bit applications.  Since AT&T Global Network Client VPN (agnclient) is 32bit-only, I encountered some new issues not previously encountered with ia32.

These issues are relevant only for Debian (including derivatives including Ubuntu) 64bit systems.  Install of the software on a 32bit system was without  issue.

Issue 1: libssl0.9.8

When I went to install agnclient_1.0~2.0.1.3003-3_i386.deb, I encountered an issue with missing dependency libssl0.9.8 which was listed as unsatisfiable (not going to be installed).  When I checked Synaptic, it listed both libssl1.0.0 and libssl0.9.8 installed.

When I try to install libssl1.0.0:i386, it indicates it is already installed.  If I try to install  libssl0.9.8:i386 I get the following error:

apt-get install libssl0.9.8:i386

Reading package lists... Done
Building dependency tree 
Reading state information... Done
Package libssl0.9.8:i386 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libssl0.9.8:i386' has no installation candidate

I manually located libssl0.9.8_0.9.8o-4squeeze13_i386.deb from the repository in LMDE ( http://debian.linuxmint.com/latest/pool/main/o/openssl/libssl0.9.8_0.9.8o-4squeeze13_i386.deb).  I installed this .deb manually (dpkg -i libssl0.9.8_0.9.8o-4squeeze13_i386.deb).  Afterwards the depedency was resolved and the application installed successfully.

The terminal version of the client (NetVPN.sh) ran fine and connected properly.

The dependencies were satisfied:


ldd agnclientd
linux-gate.so.1 =>  (0xf7782000)
libagnLogc.so.1 => /opt/agns/lib/libagnLogc.so.1 (0xf775c000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7743000)
libagnc.so.1 => /opt/agns/lib/libagnc.so.1 (0xf7739000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75eb000)
/lib/ld-linux.so.2 (0xf7783000)
libxml2.so.2 => /usr/lib/i386-linux-gnu/libxml2.so.2 (0xf7498000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7494000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf747b000)
liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xf7453000)



ldd agnLogd
linux-gate.so.1 =>  (0xf76f7000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7586000)
/lib/ld-linux.so.2 (0xf76f8000)


ldd NetVPN
linux-gate.so.1 =>  (0xf7792000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf7777000)
libssl.so.4 => /lib32/libssl.so.4 (0xf7729000)
libcrypto.so.4 => /lib32/libcrypto.so.4 (0xf75b0000)
libdl.so.2 => /lib32/libdl.so.2 (0xf75ac000)
libc.so.6 => /lib32/libc.so.6 (0xf744a000)
/lib/ld-linux.so.2 (0xf7793000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7410000)





Issue 2: agnclient (GUI) not working; missing undeclared dependencies 

There seems to be a bunch of libraries missing for the GUI version of the application that is included in the .deb installer.  The GUI doesn't run, and clearly is missing libraries:


ldd agnclient
linux-gate.so.1 =>  (0xf7794000)
libagnLogc.so.1 => /opt/agns/lib/libagnLogc.so.1 (0xf776e000)
libagnc.so.1 => /opt/agns/lib/libagnc.so.1 (0xf7765000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf774b000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7725000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7721000)
libgtk-x11-2.0.so.0 => not found
libgdk-x11-2.0.so.0 => not found
libatk-1.0.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
libpangoxft-1.0.so.0 => not found
libpangox-1.0.so.0 => not found
libpango-1.0.so.0 => not found
libgobject-2.0.so.0 => not found
libgmodule-2.0.so.0 => not found
libgthread-2.0.so.0 => not found
libglib-2.0.so.0 => not found
libxml2.so.2 => /usr/lib/i386-linux-gnu/libxml2.so.2 (0xf75cc000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf747d000)
/lib/ld-linux.so.2 (0xf7795000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7464000)
liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xf743d000)

The solution is to install libgtk2.0-0:i386 which replaces the now removed ia32-libs-gtk.

Run:
apt-get install libgtk2.0-0:i386

Now if you check the dependencies using ldd, all should be found:


ldd agnclient
linux-gate.so.1 =>  (0xf7735000)
libagnLogc.so.1 => /opt/agns/lib/libagnLogc.so.1 (0xf770f000)
libagnc.so.1 => /opt/agns/lib/libagnc.so.1 (0xf7706000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf76ec000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf76c6000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf76c2000)
libgtk-x11-2.0.so.0 => /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0 (0xf724f000)
libgdk-x11-2.0.so.0 => /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0 (0xf719e000)
libatk-1.0.so.0 => /usr/lib/i386-linux-gnu/libatk-1.0.so.0 (0xf717b000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0 (0xf7159000)
libpangoxft-1.0.so.0 => /usr/lib/i386-linux-gnu/libpangoxft-1.0.so.0 (0xf7150000)
libpangox-1.0.so.0 => /usr/lib/i386-linux-gnu/libpangox-1.0.so.0 (0xf7142000)
libpango-1.0.so.0 => /usr/lib/i386-linux-gnu/libpango-1.0.so.0 (0xf70f6000)
libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xf70a3000)
libgmodule-2.0.so.0 => /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0 (0xf709e000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xf709b000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xf6f9e000)
libxml2.so.2 => /usr/lib/i386-linux-gnu/libxml2.so.2 (0xf6e4b000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf6cfc000)
/lib/ld-linux.so.2 (0xf7736000)
libpangocairo-1.0.so.0 => /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0 (0xf6cef000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf6bb7000)
libXcomposite.so.1 => /usr/lib/i386-linux-gnu/libXcomposite.so.1 (0xf6bb4000)
libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xf6bb1000)
libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xf6baa000)
libcairo.so.2 => /usr/lib/i386-linux-gnu/libcairo.so.2 (0xf6a9c000)
libgio-2.0.so.0 => /usr/lib/i386-linux-gnu/libgio-2.0.so.0 (0xf693c000)
libpangoft2-1.0.so.0 => /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0 (0xf690e000)
libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xf6872000)
libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xf683b000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf6829000)
libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf6820000)
libXinerama.so.1 => /usr/lib/i386-linux-gnu/libXinerama.so.1 (0xf681d000)
libXi.so.6 => /usr/lib/i386-linux-gnu/libXi.so.6 (0xf680e000)
libXrandr.so.2 => /usr/lib/i386-linux-gnu/libXrandr.so.2 (0xf6805000)
libXcursor.so.1 => /usr/lib/i386-linux-gnu/libXcursor.so.1 (0xf67fb000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf67f2000)
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xf67c8000)
libXft.so.2 => /usr/lib/i386-linux-gnu/libXft.so.2 (0xf67b3000)
libffi.so.5 => /usr/lib/i386-linux-gnu/libffi.so.5 (0xf67a9000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xf676b000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf6752000)
liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xf672b000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf6708000)
libpixman-1.so.0 => /usr/lib/i386-linux-gnu/libpixman-1.so.0 (0xf6670000)
libxcb-shm.so.0 => /usr/lib/i386-linux-gnu/libxcb-shm.so.0 (0xf666c000)
libxcb-render.so.0 => /usr/lib/i386-linux-gnu/libxcb-render.so.0 (0xf6661000)
libselinux.so.1 => /lib/i386-linux-gnu/libselinux.so.1 (0xf6641000)
libresolv.so.2 => /lib/i386-linux-gnu/libresolv.so.2 (0xf662c000)
libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xf6601000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf65fe000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf65f8000)


Special Notes:

I removed the services (agnclientd and agnLogd) from loading manually (in /etc/init.d) since I don't use the VPN all the time (I wish to start it only when the need arises to connect).  Thus, I have two special scripts to start the services and to log in, when I need to.

To start the services manually in script form, here is a sample startup.sh (only need to run once unless you terminate the services or reboot)


#!/bin/sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/agns/lib
export PATH=$PATH:.:/opt/agns/bin:/opt/agns/lib:/opt/agns/bin/skin
agnclientd
agnLogd

To connect the VPN client (establish a tunnel connection) (without using the GUI):

#!/bin/sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib32
./NetVPN.sh

Remember to update NetVPN.sh to include your account (NETVPN_ACCOUNT), username (NETVPN_USERNAME), password (NETVPN_PASSWORD) and remove the comment from the line SERVICE_MANAGER_ADDRESS="204.146.172.230" to allow the client to connect.

To terminate the client, you can CTRL-C while connected.

Tuesday, 20 November 2012

Lost audio playback after unplugging headphones


Audio/sound worked fine through the Thinkpad's speaker, I then plugged in headphones which worked fine, but then after unplugging the headphones, audio/sound did not play through the speaker, and plugging the headphones back in confirmed there was no audio / sound through them.

The fix is to restart the alsa-utils service.

/etc/init.d/alsa-utils restart

Playback through both speakers and headphones was fixed.


UPDATE:

This appears to be happening on all my Thinkpads (X20, X21, X22, X23, X24, X60, X60s, X61, X61s, X61T, T420) ever since Update Pack 5 for LMDE (Linux Mint Debian Edition) [affects Update Pack 6 as well].  I'm not certain if it is an issue with LMDE or Debian Wheezy.

The issue is that if you hardware or software (using volume control) mute the sound, you cannot unmute the sound via hardware or software volume control.  The sound will appear unmuted but there is no sound.

The solution is to run alsamixer (it's a XTerm GUI app, so run from a terminal session).  You should see a sound control for PulseAudio.  You can toggle the sound on/off by pressing m (for mute/unmute).

This is the only way I have found to be able to unmute the sound.

Monday, 15 October 2012

My Proven Method for Upgrading on LMDE

I've had mixed results when using the GUI updater.

What has never failed me is this method:

1) triple check your sources.list
2) run (as root), apt-get update
3) run (as root), apt-get upgrade -d
4) run (as root), apt-get upgrade
5) [if any errors in #4], run (as root), apt-get upgrade -f
6) run (as root), apt-get dist-upgrade -d
7) run (as root), apt-get dist-upgrade
8) [if any errors in #4], run (as root), apt-get dist-upgrade -f
9) reboot and test!

Always resulted in successful upgrades. I've been down the "destroyed" system route when upgrading before.

But like always, I do a quick clonezilla of my /root partition. I consider that critical. Even if the upgrade goes smooth, you never know what show-stoppers you'll run into after the upgrade (such as a particular critical application you use is not compatible with some of the updates). You always want a rollback strategy.

Monday, 10 September 2012

Using Compiz with LMDE (updated pack 4 or later)

I used Compiz with LMDE with GNOME 2 since starting to use LMDE.

With update pack 4, the choices of window managers has changed with GNOME 2 being replaced with GNOME 3, Cinnamon and MATE (fork of GNOME 2).  I tried Cinnamon for a while, and yes it is indeed impressive, it is still too early to start using it to replace Compiz w/ GNOME 2.

To get Compiz working with MATE, there is one additional issue than with GNOME 2.  With GNOME 2, you can simply run "compiz --replace" to activate Compiz.  In MATE, this works, but then then some MATE processes end up pegging the CPU high (constant running 50% CPU on a dual core -- I would assume this would be 100% on a single core system or 25% on a quad core system).  To   stop the CPU from running high, you run a "killall -9 marco" after activating Compiz.  However, as I found, it doesn't seem to work very well from a script.  I've always had "compiz --replace" as a startup script in "Startup Application", but simply adding the kill directly after didn't seem to have the desired effect.  Even when ensuring Compiz was starting up as a background process with a &, the killall immediately after still didn't appear to be having any effect.  I also tried putting a sleep inbetween steps.

The ultimate solution is to prevent the marco from starting completely.

With that said, here is the ultimate workaround to get Mate with Compiz running as your desired Window Manager.

First, you will need to install mateconf-editor (sudo apt-get install mateconf-editor).  This will add a red-icon version of Configuration Editor to your Programs (not to be confused with gconf-editor which you may have previously installed as well).  Start mateconf-editor from a terminal or from the Programs menu.

Second, navigate to /desktop/mate/session/required_components.  Locate the windowmanager setting, and change it to either blank or compiz.  I actually went with leaving it blank and continuing my prior tradition of having a "compiz --replace" execute via "Startup Applications", rather than changing the default to Compiz.

That's it.  Now have fun with CompizConfig (ccsm) to edit and configure your Compiz environment.

If you don't have Compiz installed, install the components via Synaptic.  I prefer to install all the plugins as well to fully customize Compiz.  I use compiz-gtk, compiz-dev, libdecoation0, compiz-plugins, compiz-core, compiz-fusion-plugins-unsupported, libcompizconfig0, compizconfig-backendgconf, compiz-fusion-plugins-main, compiz-fusion-plugins-extra, compiz-fusion-bcop, and compizconfig-settings-manager.

Tuesday, 14 August 2012

SSD Efficiency: Moving .xsession-errors

The .xsession-errors file normally resides in your home directory and it gets written to very often.  There is very little purpose to this file, unless you are troubleshooting a particular X application.

For the sake of reducing writes to the hard drive (prevent waking a spinning disk, prolong the life of a SSD), I have tried to relocate the file to /tmp, which is a ramdisk.  I located the entry, ERRFILE, responsible for the file within /etc/X11/Xsession, and tried changing it,

from:

ERRFILE=$HOME/.xsession-errors
to:
ERRFILE=/tmp/.xsession-errors

However, the system keeps writing to a .xession-error file in the home directory (regardless if I delete this file or not, it gets regenerated).  The issue has persisted for weeks including after many reboots.

I came across this post http://ubuntuforums.org/showthread.php?t=1946716 which suggested making the file immutable by:


rm ~/.xsession-errors
touch ~/.xsession-errors
sudo chattr +i ~/.xsession-errors


I've done this, and now at least the file is not being written to, but likewise, there is no file generated in /tmp/.

I'll have to keep this for the time being and then remove the flag if I ever need to make use of the .xsession-errors file.

Saturday, 21 July 2012

Google Chrome popping sound in Linux


I was forced to recently upgrade my Google Chrome from Chrome 16.x to Chrome 20.x on account of LastPast simply stopped working one-day with releases < 20.x (Chrome doesn't auto-update on Linux, unless you allow it to, but LastPass forces auto-download of the latest extension each time you launch the application against your will [aside: maybe figuring out the update URL and blocking it on the router or in the Linux routing tables on the machine would prevent this]).

Obviously, the popping sound comes about from the sound card going in and out of on mode.  I noticed it immediately after upgrading, and would be prevalent on sites such as gmail.com which has many hidden flash objects in the background.  Gmail and other sites with oodles of flash were essentially making chrome pop nonstop, as if it were cooking popcorn.

I found this thread: http://forums.linuxmint.com/viewtopic.php?f=47&t=107339

Google appeared to post a fix.  I don't know why they would post a clearly Windows fix into a clearly Linux thread -- since when do .dll files exist in Linux.  I thought at least the libraries would exist in some form (.so) and the fix may still apply.  But only 1 out of the 3 referenced libraries even exist.

I tried upgrading to the unstable Chrome 22.x version (since someone in the thread posted that the problem appeared to be fixed in 21.x which is against not exactly what Google is saying).  It is still happening for me in Chrome 22.x.

Shockwave Flash will show as the current version 11.3.x.  You need to disable it and leave only 11.0 d1 enabled.

This is what I figured out actually works:
- Type about:plugins in your address bar
- Click Details on the upper right corner
- Locate the entry for libpepflashplayer.so
-- Click Disable
- Locate the entry for libflashplayer.so
-- The entry should already, if not enable it, or you'll lose flash support.

Restart Chrome and you'll be popping-free.  But you will get the annoying "there is an flash update" dialogues.  Better than the popping.

To prevent the flash update dialogues, for your shortcut that you use to start Chrome, append the following --allow-outdated-plugins.  So your shortcut may resemble the following command:
/opt/google/chrome/google-chrome --allow-outdated-plugins

UPDATE 11/20/2012:

Chrome 23+ does not suffer this "popping" issue.  I have migrated to Chrome 23.0.1271.64 on several  32bit and 64bit systems and switched back to the original default settings (to use the more up to date  libpepflashplayer.so).