Wednesday, July 9, 2014

Rdesktop on CentOS 7

I tried to install rdesktop rpm. But I didn't manage to find rpm for centos 7. Only rpm I could find was one from repoforge ( Unfortunatelly installation failed on missing dependency:

[root@centos-7 ~]# yum --nogpgcheck localinstall rdesktop-1.8.2-0.1.el6.rfx.x86_64.rpm 
Loaded plugins: fastestmirror
Examining rdesktop-1.8.2-0.1.el6.rfx.x86_64.rpm: rdesktop-1.8.2-0.1.el6.rfx.x86_64
Marking rdesktop-1.8.2-0.1.el6.rfx.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rdesktop.x86_64 0:1.8.2-0.1.el6.rfx will be installed
--> Processing Dependency: for package: rdesktop-1.8.2-0.1.el6.rfx.x86_64
Loading mirror speeds from cached hostfile
 * base:
 * extras:
 * updates:
--> Finished Dependency Resolution
Error: Package: rdesktop-1.8.2-0.1.el6.rfx.x86_64 (/rdesktop-1.8.2-0.1.el6.rfx.x86_64)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

After installing libao package (yum install libaio), problem still persists:

[root@centos-7 ~]# rpm -qa | grep libao

[root@centos-7 ~]# ls -l /usr/lib64/libao*
lrwxrwxrwx. 1 root root    14 Jul  8 13:25 /usr/lib64/ ->
-rwxr-xr-x. 1 root root 37568 Jun 10 00:05 /usr/lib64/

I have but rdesktop wants Quick and dirty workaround is to install package with --nodeps option and create symlink to satisfy rdesktop binary:

[root@centos-7 ~]# rpm -i --nodeps rdesktop-1.8.2-0.1.el6.rfx.x86_64.rpm 
warning: rdesktop-1.8.2-0.1.el6.rfx.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY

List of libraries rdesktop binary is linked to. Notice is not found:

[root@centos-7 ~]# ldd /usr/bin/rdesktop =>  (0x00007fffd3668000) => /lib64/ (0x00007fa0c4375000) => /lib64/ (0x00007fa0c3f90000) => /lib64/ (0x00007fa0c3d85000) => /lib64/ (0x00007fa0c3b7a000) => /lib64/ (0x00007fa0c380e000) => /lib64/ (0x00007fa0c3525000) => not found => /lib64/ (0x00007fa0c3309000) => /lib64/ (0x00007fa0c3104000) => /lib64/ (0x00007fa0c2dc6000) => /lib64/ (0x00007fa0c2a05000) => /lib64/ (0x00007fa0c27ba000) => /lib64/ (0x00007fa0c24da000) => /lib64/ (0x00007fa0c22d6000) => /lib64/ (0x00007fa0c20a0000) => /lib64/ (0x00007fa0c1e8a000) => /lib64/ (0x00007fa0c1c78000) => /lib64/ (0x00007fa0c1a6d000) => /lib64/ (0x00007fa0c1865000) => /lib64/ (0x00007fa0c1563000)
        /lib64/ (0x00007fa0c45e8000) => /lib64/ (0x00007fa0c1341000) => /lib64/ (0x00007fa0c1133000) => /lib64/ (0x00007fa0c0f2f000) => /lib64/ (0x00007fa0c0d14000) => /lib64/ (0x00007fa0c0b10000) => /lib64/ (0x00007fa0c08ea000) => /lib64/ (0x00007fa0c0689000) => /lib64/ (0x00007fa0c0464000)

Create as symlink for

[root@centos-7 ~]# ln -s /usr/lib64/ /usr/lib64/
[root@centos-7 ~]# 
[root@centos-7 ~]# ls -l /usr/lib64/libao*
lrwxrwxrwx. 1 root root    21 Jul  8 13:33 /usr/lib64/ -> /usr/lib64/
lrwxrwxrwx. 1 root root    14 Jul  8 13:25 /usr/lib64/ ->
-rwxr-xr-x. 1 root root 37568 Jun 10 00:05 /usr/lib64/

Library dependency is satisfied now:

[root@centos-7 ~]# ldd /usr/bin/rdesktop =>  (0x00007fff18a99000) => /lib64/ (0x00007f789c3ed000) => /lib64/ (0x00007f789c008000) => /lib64/ (0x00007f789bdfd000) => /lib64/ (0x00007f789bbf2000) => /lib64/ (0x00007f789b886000) => /lib64/ (0x00007f789b59d000) => /lib64/ (0x00007f789b394000) => /lib64/ (0x00007f789b178000) => /lib64/ (0x00007f789af73000) => /lib64/ (0x00007f789ac35000) => /lib64/ (0x00007f789a874000) => /lib64/ (0x00007f789a629000) => /lib64/ (0x00007f789a349000) => /lib64/ (0x00007f789a145000) => /lib64/ (0x00007f7899f0f000) => /lib64/ (0x00007f7899cf9000) => /lib64/ (0x00007f7899ae7000) => /lib64/ (0x00007f78998dc000) => /lib64/ (0x00007f78996d4000) => /lib64/ (0x00007f78993d2000)
        /lib64/ (0x00007f789c660000) => /lib64/ (0x00007f78991b0000) => /lib64/ (0x00007f7898fa2000) => /lib64/ (0x00007f7898d9e000) => /lib64/ (0x00007f7898b83000) => /lib64/ (0x00007f789897f000) => /lib64/ (0x00007f7898759000) => /lib64/ (0x00007f78984f8000) => /lib64/ (0x00007f78982d3000)

Better solution is to rebuild rdesktop package. If you don't want to mess with rpmbuild, you can download my package. Otherwise setup rpm building tree (according to

yum install rpm-build 

As non-root user (I chose vajko account) setup rpm building tree:

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
sudo yum install make gcc

Install source rpm package:

[vajko@centos-7 ~]$ rpm -i rdesktop-1.8.2-0.1.rfx.src.rpm 
warning: rdesktop-1.8.2-0.1.rfx.src.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
warning: user dag does not exist - using root
warning: group dag does not exist - using root
warning: user dag does not exist - using root
warning: group dag does not exist - using root

Rebuild package:

[vajko@centos-7 ~]$ rpmbuild -ba rpmbuild/SPECS/rdesktop.spec 
error: Failed build dependencies:
        libsamplerate-devel is needed by rdesktop-1.8.2-0.1.el7.centos.x86_64
        openssl-devel is needed by rdesktop-1.8.2-0.1.el7.centos.x86_64
        libXt-devel is needed by rdesktop-1.8.2-0.1.el7.centos.x86_64

Install dependencies and try to rebuild again:

[vajko@centos-7 ~]$ sudo yum install openssl-devel libXt-devel libsamplerate-devel
[vajko@centos-7 ~]$ rpmbuild -ba rpmbuild/SPECS/rdesktop.spec 
checking for x86_64-redhat-linux-gnu-pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for XRANDR... no
checking for PCSCLITE... no

SmartCard support requires PCSC, install the dependency
or disable the feature using --disable-smartcard.

error: Bad exit status from /var/tmp/rpm-tmp.s8HBzC (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.s8HBzC (%build)

Rebuilding failed because spec file is missing smartcard package dependency. Missing package is pcsc-lite-devel:

[vajko@centos-7 ~]$ sudo yum install pcsc-lite-devel
[vajko@centos-7 ~]$ rpmbuild -ba rpmbuild/SPECS/rdesktop.spec 
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/vajko/rpmbuild/BUILDROOT/rdesktop-1.8.2-0.1.el7.centos.x86_64
Wrote: /home/vajko/rpmbuild/SRPMS/rdesktop-1.8.2-0.1.el7.centos.src.rpm
Wrote: /home/vajko/rpmbuild/RPMS/x86_64/rdesktop-1.8.2-0.1.el7.centos.x86_64.rpm
Wrote: /home/vajko/rpmbuild/RPMS/x86_64/rdesktop-debuginfo-1.8.2-0.1.el7.centos.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.abuTrh
+ umask 022
+ cd /home/vajko/rpmbuild/BUILD
+ cd rdesktop-1.8.2
+ /usr/bin/rm -rf /home/vajko/rpmbuild/BUILDROOT/rdesktop-1.8.2-0.1.el7.centos.x86_64
+ exit 0

Package was built successfully. Remove installed devel packages if you don't need them for anything else:

yum remove pcsc-lite-devel openssl-devel libXt-devel libsamplerate-devel

Reinstall rpm package:

[vajko@centos-7 ~]$ sudo yum remove rdesktop
[vajko@centos-7 ~]$ sudo yum localinstall --nogpgcheck rpmbuild/RPMS/x86_64/rdesktop-1.8.2-0.1.el7.centos.x86_64.rpm


  1. great! well done, was looking for a solution to this.
    Many thx for your efforts to document this process!