September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  
99

Categories

Archives

[one-liner]: Using Yum to Download RPMs under Fedora, CentOS, and RHEL

Background

From time to time I’ve run into an RPM that won’t install via yum. These usually pop up because I’ve mixed packages in from a 3rd party repository, and the 3rd party package has some overlapping files with an already installed RPM.

Problem

Here’s an example that happened to me recently on a Fedora 10 system where I was trying to install some pulseaudio related packages.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
% yum install xmms-pulse xine-lib-pulseaudio
Package xmms-pulse-0.9.4-6.fc10.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package xine-lib-pulseaudio.i386 0:1.1.16.3-2.fc10 set to be updated
--> Processing Dependency: xine-lib = 1.1.16.3-2.fc10 for package: xine-lib-pulseaudio-1.1.16.3-2.fc10.i386
--> Finished Dependency Resolution
xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 from updates has depsolving problems
  --> Missing Dependency: xine-lib = 1.1.16.3-2.fc10 is needed by package xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 (updates)
Error: Missing Dependency: xine-lib = 1.1.16.3-2.fc10 is needed by package xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 (updates)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest

Solution

If you’re confident that this is a “false positive” type of error you can force your way around it like so. First download the RPM using the never mentioned command yumdownloader.

NOTE: yumdownloader is part of the yum-utils package.

1
% yumdownloader xine-lib-pulseaudio

Next try to install/upgrade the package.

1
2
3
% rpm -Uvh --nodeps xine-lib-pulseaudio-1.1.16.3-2.fc10.i386.rpm 
Preparing...                ########################################### [100%]
	file /usr/lib/xine/plugins/1.26/xineplug_ao_out_pulseaudio.so from install of xine-lib-pulseaudio-1.1.16.3-2.fc10.i386 conflicts with file from package xine-lib-1.1.16.3-18.fc10.i386

This is what I would consider a bogus error. For whatever reason, both RPMs share the same file, so let’s just install it already by doing a forced installation of the RPM.

1
2
3
 % rpm -Uvh --force --nodeps xine-lib-pulseaudio-1.1.16.3-2.fc10.i386.rpm 
Preparing...                ########################################### [100%]
   1:xine-lib-pulseaudio    ########################################### [100%]

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Analyzing a System's BIOS from the Commandline under Fedora 10

Background

A system’s BIOS is a treasure trove of a lot of useful info about the capabilities of a computer. BIOS, which stands for Basic Input/Output System, contains information such as:

  • motherboard manufacturer
  • system’s serial number
  • amount of RAM installed
  • the CPUs speed & signature

Normally the BIOS is accessible by pressing the delete key or the F1 key while your computer is booting up.

Problem

Occasionally I’ve wanted to check out the BIOS settings of a system without having to go through the hassle of rebooting. With the help of this nifty command line tool, dmidecode, BIOS info can be had, without having to reboot.

Solution

…from the dmidecode man page

dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

The DMI table doesn’t only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).

SMBIOS stands for System Management BIOS, while DMI stands for Desktop Management Interface. Both standards are tightly related and developed by the DMTF (Desktop Manage- ment Task Force).

Example output from a Thinkpad T42 laptop

When you first run the dmidecode command it tells you a summary of how many structures are present within your system’s BIOS.

1
2
3
4
5
% dmidecode 
# dmidecode 2.9
SMBIOS 2.33 present.
61 structures occupying 2126 bytes.
Table at 0x000E0010.

Each structure is represented by a handle ID which is a hex value of the form 0x001F, followed by it’s type and it’s size.


…. Continue reading → [one-liner]: Analyzing a System’s BIOS from the Command Line under Fedora, CentOS, or RHEL »»

Broken Arrow Keys during an Ubuntu 9.04 install on Vmware Server 1.X

Background

Recently I was trying to create a Ubuntu 9.04 vmware image using Vmware Server 1.08, but I was doing it remotely from my Fedora 10 laptop which was running Vmware Server 1.06. This can normally be done by using Vmware Server’s ability to remotely connect to other Vmware Servers.

VMware Server Console

Here’s my work flow. NOTE: Ubuntu 9.04 will be running on the vmware server on CentOS 5.4.

VMware Workflow

Problem

While going through the setup I encountered a problem I hadn’t seen before where the arrow keys didn’t appear to be working within GRUB while I was installing Ubuntu 9.04.

broken arrow keys

Solution

Turns out there is an option you can enable (i.e. set to TRUE) in the $HOME/.vmware/preferences file which fixes this.

1
xkeymap.nokeycodeMap = "TRUE"

NOTE: This change was made to the Vmware Server that was running on the Fedora 10 box.


…. Continue reading → Broken Arrow Keys during an Ubuntu 9.04 install on Vmware Server 1.X »»

Fixing Ruby Support in Vim on Fedora 10, 11, and CentOS 5 & Installing the Vim Textile plugin

Background

A while back I was trying to get the vim textile plugin installed and ran into a problem. Apparently the vim that’s included with Fedora 10, 11, and CentOS 5 doesn’t include ruby support. This bug report explains what’s wrong with vim and how it’s missing ruby support. The problem is visible with this command:

1
2
3
4
% vim --version | grep ruby
+printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind 
...
...

The –ruby tells us that ruby support isn’t enabled. The only solution I’ve seen thus far is to rebuild vim. Not really a huge deal but it’s work non the less 8-).

Rebuilding vim with ruby support

Here’s how I fixed it.

download vim Source RPM (SRPM)

1
% wget http://mirrors.xmission.com/fedora/updates/10/SRPMS/vim-7.2.148-1.fc10.src.rpm

confirm that ruby is installed

1
2
3
4
5
6
% yum list installed ruby*|column -t|grep ruby
ruby.i386        1.8.6.287-2.fc10  installed
ruby-devel.i386  1.8.6.287-2.fc10  installed
ruby-irb.i386    1.8.6.287-2.fc10  installed
ruby-libs.i386   1.8.6.287-2.fc10  installed
ruby-rdoc.i386   1.8.6.287-2.fc10  installed

make sure you have your own rpmbuild directory

1
2
3
4
% mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
 
# caution with this second command if you already have your own .rpmmacros, this will overwrite!
% echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

rebuild vim / re-install vim

1
2
rpmbuild --rebuild vim-7.2.148-1.fc10.src.rpm
rpm --force -Uvh /root/rpmbuild/RPMS/i386/vim-{c,e,m,X}*

check that vim now has ruby support

1
2
3
4
% vim --version | grep ruby
+printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind 
...
...

Ahh. a +ruby means it worked.

Textile Plugin for vim

Now onto installing the vim textile plugin.

First things first, we need to install rubygems

1
% yum install rubygems

Next we need to install the RedCloth gem, it’s required by the textile plugin

1
2
3
4
5
6
% gem install RedCloth
Building native extensions.  This could take a while...
Successfully installed RedCloth-4.2.2
1 gem installed
Installing ri documentation for RedCloth-4.2.2...
Installing RDoc documentation for RedCloth-4.2.2...

Finally, install the textile plugin

Downloading the textile plugin from here,


…. Continue reading → Fixing Ruby Support in Vim on Fedora 10, 11, and CentOS 5 & Installing the Vim Textile plugin »»

[one-liner]: Determining a Hard Drive’s Manufaturer Under Fedora 10 & CentOS 5

Background

I recently saw a post over on Linux Journal that discussed how to glean information about a system’s hard drive, such as its serial number, without having to actually open up the case and physically check it. So I thought I’d take the opportunity to write up a blog post with the specifics of how to do this under Fedora & CentOS, just so I’d have this info handy for future use.

BTW, I was able to accomplish this task several different ways, so this post will cover all the different ways that I could get this info.

Command #1: lshw

This is probably the best tool for getting at a system’s internals. First make sure it’s installed.

1
yum install lshw

For our example you would run the command lshw -class disk:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% lshw -class disk
  *-disk                  
       description: ATA Disk
       product: HTS726060M9AT00
       vendor: Hitachi
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: MH4O
       serial: MRH403M4GS551Y
       size: 55GiB (60GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=cccdcccd
  *-cdrom
       description: DVD reader
       product: UJDA755yDVD/CDRW
       vendor: MATSHITA
       physical id: 1
       bus info: scsi@1:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/cdrw
       logical name: /dev/dvd
       logical name: /dev/scd0
       logical name: /dev/sr0
       version: 1.71
       capabilities: removable audio cd-r cd-rw dvd
       configuration: ansiversion=5 status=nodisc

The first section that’s returned is called -disk. Here’s you’ll see the vendor: Hitachi, the product number, HTS726060M9AT00, and my serial number: MRH403M4GS551Y.

Command #2: smartctl

The next tool that would give this type of info is called smartctl. It’s a tool that’s part of the smartmontool package. You may be familiar with the acronym S.M.A.R.T.. The acronym stands for: Self-Monitoring, Analysis, and Reporting Technology. This is a standard that most modern disks have in which vital statistics about a disk drive are provided through a standard API. Here’s how to install it.

1
yum install smartmontools

…and once installed you can use the bundled in tool smartctl like so:


…. Continue reading → [one-liner]: Determining a Hard Drive’s Manufaturer Under Fedora 10 & CentOS 5 »»

Howto Stop Clock Drift Issues on a CentOS 5 OpenVZ Host Node

I’ve been dealing with a nagging problem for several months. The problem? I can’t get my OpenVZ Host Node, aka. HN, to keep consistent time. I’ve even been running ntpd, and the time would still invariably drift so that the HN and the Virtual Environments, aka. VEs, running on the HN were all several hours behind. Simply restarting ntpd would temporarily fix the situation, but I shouldn’t have to do that.

So I finally hunkered down and figured out how to solve this problem. These 2 threads proved extremely helpful in determining the fix.

These threads offered 2 fixes to try. The first, was to modify the ntp.conf file so that any server definitions now included the burst & iburst switches like this:

1
2
3
4
# /etc/ntp.conf
...
server 192.168.1.6 burst iburst
...

Adding these switches seemed to help, but then my /var/log/messages log started getting filled with synch attempts by ntpd like these:

1
2
3
4
5
6
7
8
9
10
11
12
Jul 10 03:50:18 mulder ntpd[15032]: synchronized to LOCAL(0), stratum 10
Jul 10 03:51:24 mulder ntpd[15032]: synchronized to 192.168.1.6, stratum 3
Jul 10 03:59:59 mulder ntpd[15032]: synchronized to LOCAL(0), stratum 10
Jul 10 04:01:21 mulder ntpd[15032]: synchronized to 192.168.1.6, stratum 3
Jul 10 04:11:52 mulder ntpd[15032]: synchronized to LOCAL(0), stratum 10
Jul 10 04:15:05 mulder ntpd[15032]: synchronized to 192.168.1.6, stratum 3
Jul 10 04:27:56 mulder ntpd[15032]: synchronized to LOCAL(0), stratum 10
Jul 10 04:30:06 mulder ntpd[15032]: synchronized to 192.168.1.6, stratum 3
Jul 10 04:41:53 mulder ntpd[15032]: synchronized to LOCAL(0), stratum 10
Jul 10 04:47:17 mulder ntpd[15032]: synchronized to 192.168.1.6, stratum 3
Jul 10 05:03:28 mulder ntpd[15032]: synchronized to LOCAL(0), stratum 10
Jul 10 05:12:05 mulder ntpd[15032]: synchronized to 192.168.1.6, stratum 3

The second suggestion was the key tip. It recommended that you add a kernel switch called clock=pmtmr to the grub.conf file. Once I tried this I received a warning message in the dmesg log stating that this switch had been deprecated, and the new switch was now clocksource=acpi_pm.

1
2
3
4
5
% dmesg | grep -i clock
Command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet clock=pmtmr
Kernel command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet clock=pmtmr
Warning: clock=pmtmr is deprecated. Use clocksource=acpi_pm.
Real Time Clock Driver v1.12ac

So I modified the grub.conf to incorporate the clocksource switch, rebooted the system, and was rewarded with a cleaner dmesg.

1
2
3
4
% dmesg | grep -i clock
Command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet clocksource=acpi_pm
Kernel command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet clocksource=acpi_pm
Real Time Clock Driver v1.12ac

A quick check of /var/log/messages looked good, no more ntpd synch messages:

1
2
3
4
5
6
7
8
9
10
11
Jul 11 00:30:49 mulder ntpd[24578]: ntpd 4.2.2p1@1.1570-o Thu Apr  9 12:53:31 UTC 2009 (1)
Jul 11 00:30:49 mulder ntpd[24579]: precision = 1.000 usec
Jul 11 00:30:49 mulder ntpd[24579]: Listening on interface wildcard, 0.0.0.0#123 Disabled
Jul 11 00:30:49 mulder ntpd[24579]: Listening on interface wildcard, ::#123 Disabled
Jul 11 00:30:49 mulder ntpd[24579]: Listening on interface lo, ::1#123 Enabled
Jul 11 00:30:49 mulder ntpd[24579]: Listening on interface veth103.0, fe80::218:51ff:fe43:8487#123 Enabled
Jul 11 00:30:49 mulder ntpd[24579]: Listening on interface vmbr0, fe80::222:15ff:fe91:c12d#123 Enabled
Jul 11 00:30:55 mulder ntpd[24579]: kernel time sync status 0040
Jul 11 00:30:56 mulder ntpd[24579]: frequency initialized 25.118 PPM from /var/lib/ntp/drift
Jul 11 00:42:51 mulder ntpd[24579]: synchronized to LOCAL(0), stratum 10
Jul 11 00:43:54 mulder ntpd[24579]: synchronized to 192.168.1.6, stratum 3

Just to be on the safe side, I opted to leave the burst & iburst switches on the server line in the /etc/ntp.conf file. For completeness, I researched what the burst/iburst switches do. Here are those descriptions right out of the ntp.conf man page:

burst – When the server is reachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the calldelay command to allow additional time for a modem or ISDN call to complete. This option is valid with only the server command and is a recommended option with this command when the maxpoll option is 11 or greater.

iburst – When the server is unreachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the calldelay command to allow additional time for a modem or ISDN call to complete. This option is valid with only the server command and is a recommended option with this command.

After waiting for ~2 hours, I still did not see anymore of the ntp synch messages in /var/log/messages. Since the burst/iburst switches don’t seem to be causing any additional problems I’m going to leave them on going forward, and I may remove them completely at a later date. For now, I’m going to wait and make sure that the time remains stable before I do that.

Page 1 of 3123