How to force yum to uninstall a package when you change it’s name
By Joao
Use the obsoletes tag in the specfile. This will cause “package-oldname” to be uninstalled before installing “package-renamed”.
Name: package-renamed
Obsoletes: package-oldname
Using dd to create large files
By Joao
An example of using dd to create a 1GB file.
dd if=/dev/zero of=testfile bs=1M count=1024
How to temporarly ignore foreign keys in MySQL InnoDB.
By Joao
SET FOREIGN_KEY_CHECKS = 0;
SELECT @@FOREIGN_KEY_CHECKS;
SET FOREIGN_KEY_CHECKS = 1;
Alexander Stetsenko blog has more info about it.
Apache2::Request rpm
By Joao
Not immediately obvious, but if you’re looking for an rpm to install the Apache2::Request module you need perl-libapreq2 (this works in CentOS 5 and I imagine others as well).
yum install perl-libapreq2
Common yum commands
By Joao
List available repositores
yum repolist
Search by package name (case insensitive)
yum list "*package*"
List files inside a repository package (regardless if that package has been installed)
repoquery --list <PACKAGE_NAME>
Give passwordless sudo access to a user
By Joao
Add the following to the /etc/sudoers file:
<USERNAME> ALL= NOPASSWD: ALL



October 29th, 2009