extract – Internetblog.org.uk https://www.internetblog.org.uk Web hosting, Domain names, Dedicated servers Fri, 29 Jan 2016 11:05:52 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 https://www.internetblog.org.uk/files/2016/01/cropped-favico-32x32.png extract – Internetblog.org.uk https://www.internetblog.org.uk 32 32 Useful RPM Tips https://www.internetblog.org.uk/post/1366/useful-rpm-tips/ Thu, 27 May 2010 17:07:05 +0000 http://www.internetblog.org.uk/post/1365/useful-rpm-tips/ RPM logoAs I mentioned in an earlier post, YUM is a powerful package management system, commonly used in RPM-based Linux distributions, including Red Hat Enterprise Linux, CentOS, and Fedora. We have covered some of the basic YUM commands. Now, here are some helpful commands not in YUM that you can use to better manage your RPM packages.

1. Reset file permissions – This is for those times when you have made changes to an application that you probably should not have made. RPM can reset the permissions for all files in the package and return them to the state they were in when you installed it. Simply run this command:

rpm --setperms

2. Extract one file from an rpm – Whenever you do not actually want to install an RPM, you can extract its contents. This is also useful if you have changed something in one of the files and just need to extract the default file, like logrotate.conf. Run this command:

rpm2cpio logrotate-1.0-1.i386.rpm |cpio -ivd etc/logrotate.conf

3. Query 3rd party packages – In this example, suppose you are using CentOS, but you want to query packages from other repositories. This command will allow you to find packages not in the CentOS repository.

rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v CentOS

]]>