linuxsysconfig

Configure your Linux system

Nvidia drivers on CentOS 7

Since RPM Fusion doesn’t support RHEL / CentOS 7 and I didn’t feel like dealing with the Nvidia installer, I tried to find alternative package repositories. Fortunately I came across ELRepo which has been providing Nvidia drivers (from the long-lived branch release) in form of precompiled kernel drivers (kmod-nvidia) for a few months.

I tested it on a fresh CentOS 7 installation (using the GNOME Desktop option) and it was pretty straightforward.

 

Import the rpm GPG key

 

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

 

Install ELRepo

 

yum install http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

 

Remove Glamor

 

This is an open source Xorg graphics driver that may cause conflicts with proprietary drivers. If the package is installed it needs to be removed.

yum remove xorg-x11-glamor

 

Install nvidia-detect [ optional ]

 

This is a small utility which detects graphic cards, suggests specific driver versions and checks compatibility with Xorg.

yum install nvidia-detect

Sample output:

nvidia-detect -x
Probing for supported NVIDIA devices...
[10de:11c0] NVIDIA Corporation GK106 [GeForce GTX 660]
This device requires the current 340.32 NVIDIA driver kmod-nvidia
[10de:11c0] NVIDIA Corporation GK106 [GeForce GTX 660]
This device requires the current 340.32 NVIDIA driver kmod-nvidia

Checking ABI compatibility with Xorg Server...
Xorg Video Driver ABI detected: 15
ABI compatibility check passed

 

Install kmod-nvidia

 

When running a 64bit OS, the 32bit Nvidia libraries may also be needed for compatibility, I always install them. The good thing is that kmod-nvidia also disables nouveau automatically, so no more manually tweaking modprobe and grub :)

yum install kmod-nvidia nvidia-x11-drv-32bit

via elrepo.org

Automatic desktop cleanup

Desktop Cleanup was the name of an old Windows XP utility used to remove unwanted shortcuts from the desktop. Somewhat useful considering that most Windows installers create desktop shortcuts by default, but extremely limited as it didn’t support other file formats. In the Linux world such an application would be pretty much worthless, but there are [more powerful] ways to deal with unorganized files such as those from ~/Desktop.

I work with several Linux desktop machines (both physical and virtual) daily and I tend to be a little messy when it comes to saving files downloaded via web browser or securely copied from remote locations. My thinking is “I’ll put these on the desktop as they are important and I need to find them easily”. Or course I find many things important so I end up having a full desktop pretty quickly.

One simple way to clean up the Linux desktop periodically is to move or delete unnecessary files automatically during boot. This can be done by adding specific commands to /etc/rc.d/rc.local. I’m using this setup for a while now on several CentOS and Fedora machines which I manage to keep clean and organized.

 

Samples

 

  • ┬ásearch the desktop for links (shortcuts to applications) and move them to a specific folder
find /home/lsc/Desktop/ -maxdepth 1 -type f -name "*.desktop" -exec mv -t /home/lsc/Desktop/shortcuts {} \+
  • search for documents and move them to a folder
find /home/lsc/Desktop/ -maxdepth 1 -type f -regextype egrep -regex '.*.(txt|doc|docx|xls|xlsx|pdf)' -exec mv -t /home/lsc/Desktop/docs {} \+
  • search for image files and move them accordingly
find /home/lsc/Desktop/ -maxdepth 1 -type f -regextype egrep -regex '.*.(jpg|jpeg|png)' -exec mv -t /home/lsc/Desktop/pics {} \+
  • search one level of directories deeper and move all files that were accessed more than 10 days ago
find /home/lsc/Desktop/ -maxdepth 2 -type f -atime +10 -exec mv -t /home/lsc/Desktop/archive {} \+
  • search for files that were modified more than 30 days ago and delete them
find /home/lsc/Desktop/ -maxdepth 1 -type f -mtime +30 -exec rm -rf {} \;

If you put any of these sample commands (customized to suit your needs and environment) in /etc/rc.d/rc.local they will be executed automatically during the boot process. Note that some distributions using systemd may not have this file, so you might want to try creating a systemd service or even using crontab as an alternative. Luckily, Red Hat 7 and CentOS 7 do keep this file for compatibility reasons, only one extra step is required to make it executable.

chmod +x /etc/rc.d/rc.local

Hope this helps!

Install Citrix Receiver on CentOS 7

For those using Citrix Receiver to access resources from a Citrix-powered infrastructure here’s a quick installation guide for the Linux client on the recently released CentOS 7. I tested both release 12.1 and release 13.0 on a fully updated CentOS 7 64-bit instance.

[Read the rest of this entry…]

Inplace upgrade from OL6.5 to OL7

Oracle Linux 7 was released yesterday and I was keen to test the new upgrade feature after trying it on CentOS. As far as I know the CentOS inplace upgrade is still work in progress, so I expected Oracle Linux to perform better since they advertised it in the release notes and they also provide official instructions. Unfortunately I didn’t have the chance to test on Red Hat since I don’t own a customer subscription, but I can assume it will do fine, after all they were the ones who developed the upgrade tool in the first place.

Anyway, Oracle has published specific requirements for the upgrade like having the UEK3 (their Unbreakable Enterprise Kernel Release 3) set as the default kernel, the minimum package set installed for OL 6.5 (according to /usr/lib/anaconda/installclasses/enterprise.py that means the core package group) and also no running Oracle applications. I did my testing on a VM running Oracle Linux 6.5 under VirtualBox. Again, please note the following is just of proof of concept, don’t do this on production machines!

 

Add the addon repo

 

First thing after updating the OL 6.5 instance was to add the ol6_addons repository. For some reason, it wasn’t available in /etc/yum.repos.d/public-yum-ol6.repo so I had to edit the file and add it manually:

[ol6_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

Another option is to download the packages from the repo URL http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/ and install them manually with yum localinstall $package_name.

 

Install the rpms

 

yum install openscap preupgrade-assistant-contents redhat-upgrade-tool

 

Run preupgrade

 

preupg

The command completed successfully but it reported critical errors. Additional information is available in /root/preupgrade/result.html which is an html file that can be viewed in a web browser.

First warning:

We found some critical issues. In-place upgrade is not advised.

Since this was just a test I decided to ignore the warning and proceed. This time I used the OS DVD as the installation source, so the upgrade command is slightly different. The debug redirection is optional but useful to troubleshoot errors.

 

Run the upgrade tool

 

redhat-upgrade-tool-cli --device=/dev/sr0 --debuglog=/tmp/upgrade.log

Second warning:

preupgrade-assistant risk check found EXTREME risks for this upgrade.
Run preupg –riskcheck –verbose to view these risks.
Continuing with this upgrade is not recommended.

Again (and same as on CentOS) the command doesn’t run because of the failed preupgrade output. In my case I had GNOME installed and upgrade from GNOME 2 to GNOME 3 is not officially supported. I chose to force the upgrade anyway for the sake of testing.

redhat-upgrade-tool-cli --force --device=/dev/sr0 --debuglog=/tmp/upgrade.log

Forcing it did the trick so the pre-upgrade process completed successfully. Rebooting the machine entered the upgrade state by default and the whole process went through without glitches (there was no database environment version mismatch error). As expected, after reboot the OS didn’t boot to X, so I had to modify GRUB to enter runlevel 3 by default. Nonetheless it was a successful testing in my opinion, but I would have expected more from Oracle (at least some partial support for Oracle application stack).

As a side note, I don’t understand why Oracle still uses that garish red background for the default boot menu, it really hurts the eye and it doesn’t look enterprise at all.