RPM Tips

From trapsink.com
Jump to: navigation, search


Remove 32bit Packages

rpm -qa --queryformat='%{n}-%{v}-%{r}.%{arch}\n' | grep '\.i[3456]86$' | xargs rpm -ev


Compile Python bytecode

Python files should be precompiled and included in the RPM to avoid SElinux problems, as well as providing pre-compiled bytecode for the non-root users.

# Precompile python modules to avoid selinux issues later
python -mcompileall %{buildroot}/some/package/directory
python -O -mcompileall %{buildroot}/some/package/directory