An occasional outlet for my thoughts on life, technology, motorcycles, backpacking, kayaking, skydiving...

Friday, December 5, 2008

RPM One-liners

I prefer the apt package manager used by Debian based Linux distributions, but am forced to deal the Red Hat Enterprise Linux professionally. For that, I keep this list handy.

###############
## rpm tasks ##
###############

# Get a (sorted) list of install packages
rpm -qa|sort|less

# find out what version of samba-client is installed
rpm -qa samba-client

# Find out how a certain file got here
rpm -q --whatprovides `locate libmysqlclient.so | sed '1p;d'`
# or
rpm -q --whatprovides `which smbmount`

# Extract files from an rpm
mkdir tmp; cd tmp; rpm2cpio ../pkg.rpm | cpio -id

# import a public key to resolve error like:
# Warning: ...rpm: 3 DSA signature: NOKEY, key ID 5072e1f5
k=5072e1f5; gpg --recv-keys $k; gpg --export -a $k > /tmp/$k.asc; sudo rpm --import /tmp/$k.asc;
# and to verify and clean-up...
rpm -qa | sort | grep pubkey; rm /tmp/$k.asc

##################################
## yum based package management ##
##################################

# add Fedora epel repository to CentOS
wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-2.noarch.rpm
k=217521f6; gpg --recv-keys $k; gpg --export -a $k > /tmp/$k.asc; sudo rpm --import /tmp/$k.asc;
sudo yum install epel-release-5-2.noarch.rpm

# find out what versions of samba-client are are available
yum search samba-client

# install samba-client
yum install samba-client

# update an old version of samba-client
yum update samba-client

######################################
## up2date based package management ##
######################################

# Get help on using RPM repositories
up2date|less

# Get a list of all available packages
up2date --showall > /tmp/up2date.all.txt

# Install the package perl-DBD-MySQL from the repository
up2date -i perl-DBD-MySQL

No comments:

Post a Comment

Followers

About Me

My photo

Believe it or not, I've never been to jail. Not even for a night. I quit going to bars by the time my fake ID was unnecessary, and I quit hacking into businesses and governments once they started paying me.

Now I just provide for my family and try not to notice politics. I get too angry when I watch how much of my income is taken from me, how it is used, and who is doing it. For the same reason, I can't bear to acknowledge celebrities.

After high school, I went to U of K but the outdated computer engineering curriculum and the seemingly endless amounts of money to be made with my internet specific skills drew me to larger tech markets. I have worked in Silicon Valley, New York City, and have settled in Atlanta.