Linux HOWTOs

About | Home | Search

HOWTO: cpufrequtils
Description: Library and command line tools for the cpufreq subsystem
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# cpufrequtils 002
# ================
# Linux kernel with CONFIG_CPU_FREQ and related options set
# sysfsutils
# gawk
# sed
# grep
# gettext (for the utils)

# Older versions used configure, who's default prefix was /usr/local.
# The three digit number versions use a default prefix of /usr.  So,
# skip down to the bottom to remove the old version if you have one
# installed, or pass DESTDIR to make.

# I pass NLS=false to make below because I live in the US and only
# read/write (well) English.  If this is not the case for you, just run
# 'make'.

test -f installed/cpufrequtils-002.tar.bz2 &&
 mv installed/cpufrequtils-002.tar.bz2 .
test ! -f cpufrequtils-002.tar.bz2 &&
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cpufrequtils-*" -exec rm -r {} \;
tar xjvf ~/cpufrequtils-002.tar.bz2
cd cpufrequtils-002
test $UID = 0 && chown -R root:root .
make NLS=false

# Become root to install it

make install

# See 'cpufreq-info --help' and 'man cpufreq-info' for usage info about it.
# To display cpufreq info, run:

# See 'cpufreq-set --help' and 'man cpufreq-set' for usage info about it.
# To change the governor to 'ondemand':
cpufreq-set -g ondemand

# Become yourself again

mkdir -p -m 0700 installed
rm -f installed/cpufrequtils-*.tar.*
mv cpufrequtils-002.tar.bz2 installed/

# If you ever need to uninstall cpufrequtils, this should do it:
test -d src/cpufrequtils-* &&
 ( cd src/cpufrequtils-* ; make uninstall )
for pfx in /usr /usr/local; do
  ( cd ${pfx}/bin ; rm -f cpufreq-info cpufreq-set )
  ( cd ${pfx}/man/man1 ; rm -f cpufreq-info.1 cpufreq-set.1 )
  rm -f ${pfx}/include/cpufreq.h ${pfx}/lib/libcpufreq.*
find ~/src -maxdepth 1 -type d -name "cpufrequtils-*" -exec rm -r {} \;
rm -f ~/installed/cpufrequtils-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>