Archive

Archive for the ‘Linux’ Category

CentOS 6 libevent multilib issues

June 24th, 2015 No comments

Trying to run a `yum update` on a CentOS 6.4 box was giving multilib errors and failing horribly (this is after sorting out the epel repo ssl problem). After much faffing I finally resolved1 it.

First, the error:

[[email protected]~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink | 21 kB 00:00
* epel: anorien.csc.warwick.ac.uk
* remi: remi.check-update.co.uk
* rpmforge: ftp.nluug.nl
epel | 4.4 kB 00:00
epel/primary_db | 6.6 MB 00:04
Setting up Update Process
Resolving Dependencies
–> Running transaction check

< -- Packages snipped for berevity, full output is at the bottom of the post -->

–> Finished Dependency Resolution
–> Running transaction check
—> Package kernel.x86_64 0:2.6.32-279.14.1.el6 will be erased
–> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:

1. You have an upgrade for libevent-devel which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libevent-devel of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
–exclude libevent-devel.otherarch … this should give you an error
message showing the root cause of the problem.

2. You have multiple architectures of libevent-devel installed, but
yum can only see an upgrade for one of those arcitectures.
If you don’t want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.

3. You have duplicate versions of libevent-devel installed already.
You can use “yum check” to get yum show these errors.

…you can also use –setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).

Protected multilib versions: libevent-devel-2.0.19-1.rhel6.x86_64 != libevent-devel-1.4.13-4.el6.i686
Error: Protected multilib versions: libevent-1.4.13-4.el6.i686 != libevent-2.0.19-1.rhel6.x86_64
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
[[email protected]~]#

damn that libevent. This probably isn’t helped by the fact we’ve got a handful of 3rd party repos in use.
The PostgreSQL repo actually includes compat-libevent14 which seems to fulfil our needs, so here are the steps to sort everything out:

Read more…

 


  1. I hope I resolved it, it’s going into production in the morning

 

Categories: CentOS & RHEL 6 Tags:

CentOS 6 EPEL & YUM issues

June 24th, 2015 No comments

when trying to update an older CentOS 6.4 box, I was getting hte following errors:

[[email protected]~]# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was
14: problem making ssl connection
* epel: mirror.bytemark.co.uk
* remi: remi.check-update.co.uk
* rpmforge: ftp.nluug.nl
…………

Other places in the internet have suggested editing /etc/yum.repos.d/epel.repo and changing the URL from https://…. to http:// (removing the SSL). This does actually work, but it doesn’t seem very clever.

After lots of going round in circles and then some more clever diffing (`curl -v` is your friend) I realised that the SSL CAs on the box were out of date so it fails to validate the mirror list. And there’s a very easy and correct fix:

yum update ca-certificates

After doing the above epel and everything else is much happier.

Note, on my box, the following deps are also updated:

=================================================================================================================================
 Package                            Arch                   Version                                 Repository               Size
=================================================================================================================================
Updating:
 ca-certificates                    noarch                 2015.2.4-65.0.1.el6_6                   updates                 1.3 M
 nss                                x86_64                 3.18.0-5.3.el6_6                        updates                 856 k
Installing for dependencies:
 p11-kit                            x86_64                 0.18.5-2.el6_5.2                        base                     94 k
 p11-kit-trust                      x86_64                 0.18.5-2.el6_5.2                        base                     71 k
Updating for dependencies:
 nspr                               x86_64                 4.10.8-1.el6_6                          updates                 113 k
 nss-softokn                        x86_64                 3.14.3-22.el6_6                         updates                 262 k
 nss-softokn-freebl                 x86_64                 3.14.3-22.el6_6                         updates                 167 k
 nss-sysinit                        x86_64                 3.18.0-5.3.el6_6                        updates                  45 k
 nss-tools                          x86_64                 3.18.0-5.3.el6_6                        updates                 433 k
 nss-util                           x86_64                 3.18.0-1.el6_6                          updates                  66 k

Transaction Summary
=================================================================================================================================
Install       2 Package(s)
Upgrade       8 Package(s)

Total download size: 3.3 M
Is this ok [y/N]:

To finish off I then run

yum clean all
yum makecache
Categories: CentOS & RHEL 6 Tags: ,

Cisco PacketTracer install Linux

January 22nd, 2015 3 comments

Installing 32bit Cisco Packet Tracer 6 on 64bit ubuntu 14 causes headaches.
Here’s how to get it running -read more for the steps I went through to work this out and don’t just run commands blindly without understanding them.

# possibly magic quickfix

dpkg --add-architecture i386

apt-get update
apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 libssl1.0.0:i386 libssl-dev:i386 libssl1.0.0 libssl-dev libx11-dev:i386 libxrender-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libglib2.0-dev:i386 libqtwebkit4:i386

At this point, if you try and launch /opt/pt/bin/PacketTracer6 directly you end up with missing ‘libQtWebKit.so.4’ errors. Launch `/usr/local/bin/packettracer` and it works (as the script sources the libraries it ships with).

On the flipside, linux mint (matte) runs it first time with no faffing about :)

Continue reading for why and how we got to this point.

Read more…

Network cloning disks like a pro

October 20th, 2013 No comments

So you want to clone a hard drive over a network, it’s ok, we’ve all been there. We want quick and easy and preferably some level of integrity insurance.

Boot systemrescuecd on box boxes and make sure both have an IP address and can ping each other. My example IPs are listed below -it’s worth pointing out that you should only do this over a trusted network, there’s no transport level security so potentially someone could be intercepting your stream.

Source: 192.168.0.5
Destination: 192.168.0.10

linux treats everything as files, so we can throw an iso image as easily as we can throw a hard drive, eg

#destination
nc -lp 1337 | dd of=/tmp/bigIsoFromSource.iso

#source
dd if=./MyBigIso.iso | nc 192.168.0.10 1337

Nice (nice). Now, you should be running md5sum on the files at both ends to make sure it wasn’t corrupted in transport, but if it’s a big file (or a disk partition) that could take a while. Wouldn’t it be good if we could split the streams (or split the pipe) so we could send the same read data from dd to both netcat and md5sum on the source, and the same on the destination? tee is our friend.

#destination
nc -lp 1337 | tee >(md5sum) | dd of=/tmp/bigIsoFromSource.iso

#source
dd if=./MyBigIso.iso | tee >(md5sum) | nc 192.168.0.10 1337

Cool beans, so now it gets checked on both sides of the network connection. It doesn’t let us see what’s going on though. you can send a `kill -USR1 <ddpid>` to dd’s process ID and it’ll print to stderror how far it’s gotten, but unless you stick it inside of wait it’s not automagically updating. For this we can use pipe viewer, which lets us see the state of data going through a pipe. If you’re feeling clever and know how big the file/partition/disk is, then you can pass the size to pv for even prettier output.

#destination
nc -lp 1337 | tee >(md5sum) | pv -s4.5G | dd of=/tmp/bigIsoFromSource.iso

#source
dd if=./MyBigIso.iso | tee >(md5sum) | pv -s4.5G |  nc 192.168.0.10 1337

and then just to be silly we’re going to compress it and calculate the hashes on both sides for both the raw input/output as well as for the compressed file that gets shoved over the network (hey, cores are cheap, right?)

#destination
nc -lp 1337 | tee >(echo -e “compressed: $(md5sum)’\n) | pv -s4.5G | bunzip2 | tee >(echo -e “raw: $(md5sum)’\n) | dd of=/tmp/bigIsoFromSource.iso

#source
dd if=./MyBigIso.iso | tee >(echo -e “raw: $(md5sum)’\n) | pv -s4.5G | bzip2 | tee >(echo -e “compressed: $(md5sum)’\n) |  nc 192.168.0.10 1337

*note nc under centos wants just the l and no p passing on the destination side, otherwise it errors out. so `nc -lp 13337` fails, but `nc -l 1337`works.

Categories: Linux Tags: , ,

CentOS/RHEL 5 wont boot when converted to vmware with SCSI/SATA Disk

October 20th, 2013 No comments

So you’ve taken your physical install of centos/rhel 5 and cloned the disk into a virtual machine, and now it won’t boot, or even mor eannoyingly it half boots and then tells you it can’t find it’s partitions even though it’s just happily read it’s way through boot.

The usual touted fix for this is to make sure your disk is set to IDE, and this does work, but it’s an annoying fix, so to work as a scsi disk:

edit /etc/modprobe.conf and remove any alias lines referring to scsi_hostadapter and replace with

alias scsi_hostadapter mptbase

alias scsi_hostadapter1 mptspi

alias scsi_hostadapter 2 ata_pixx

then we need to rebuild the initrd so these modules are available at boot

mkinitrd -fv /boot/initrd-$(uname -r).img $(uname -r)

and done; sync && reboot :)

 

Stepping up the game

August 13th, 2013 No comments

Wiresharking lo with a gui on a remote headless server:
(because when your ssl wrapped (stunnel) smtp auth fails, logs aren’t as good as bytes.)

ssh [email protected]
yum install xorg-x11-xauth dejavu-lgc-sans-fonts wireshark-gnome
reboot
ssh -X [email protected]
wireshark&

win -assuming you use linux on your desktop 😉

after the break, for windows:

Read more…

Categories: Howto, Linux Tags: , , , ,

A quick thought about SSDs

April 28th, 2013 2 comments

my slow 160tb system disk. Slow but still SATA II

After the break some quick screenshots of HDD benchmarks. -Look at the speed on the SSD 😉

Also, can you believe Samsung 256GB SSD for under £60? Get me one of those :)

Read more…

Categories: HardWare, Linux Tags: , ,

zsh magic

April 6th, 2013 No comments

sometimes you need to copy a file in a remote directory (like backing up a config file).
If its not in your current working directory, then you can end up with silliness like

cp /usr/src/linux/arch/x86/boot/bzImage /usr/src/linux/arch/x86/bzImage.backup

-lots of duplication. I’ve been trying to find a better way for years but never found it.

Khayyam in #Gentoo cracked it within moments of me asking (after setting me onto zsh (a different shell to bash))
with zsh you can do the clever thing of:

echo /usr/src/linux/arch/x86/boot/bzImage !#1.copy


which auto-expands to

/usr/src/linux/arch/x86/boot/bzImage /usr/src/linux/arch/x86/bzImage.backup

massive thanks to Khayyam who also has some immense .zsh customization & scripts on the go. He also suggests that you check out http://zshwiki.org for more excellent tips :)

edit: in bash you can just do cp /path/to/file.png{,.old}

Categories: zsh Tags: ,

32bit Wine 64bit Gentoo

December 24th, 2010 No comments

Gentoo now lets you compile wine with the win32 or win64 useflags.

If you’re on 64bit linux then all your wine “prefix’s” become 64bit as default. My googling of the internet seems to suggest you need an entire 32bit chroot or other sillyness to have some good old 32bit action (I want to play Portal).

WINEARCH=win32 WINEPREFIX="/home/user/.wine-portal" wineboot

is what I’m grepping through my bash history looking for :)

Categories: Gentoo, WINE Tags: , ,

[solved] E17: Cursor problems & no Screen Flip

October 10th, 2009 No comments

After crippling my system (don’t update libjpeg when every single one of your GUI based apps is built against it) I found myself having to reinstall E17.

Two major issues seems to jump out at me, though both are easily fixed.

  1. Screen Flip Stops Working
  2. Xorg starts eating up tonnes of memory.

Read more…

Categories: e17, Linux Tags: