Add to Favourites Add to Favourites    Print this Article Print this Article

How to create a uname wrapper to return a i686 instead of x86_64

If you're running a 32-bit vps on a 64-bit master OS, then the "uname -m" may return a 64-bit result even though you're running a 32-bit system.  You can create a wrapper for uname to return the value you want:

cd /bin
mv uname uname.orig
nano uname

in the uname wrapper script, enter the code:


if [ $# -eq 1 ] && [ "$1" = "-m" ]; then
            echo "i686";
            exit 0;

/bin/uname.orig $@
exit $?

then type

chmod 755 uname
./uname -m
./uname -r

to chmod the script to make it executable, and to test the output.

Was this answer helpful?

Also Read