Install Adobe Reader on Fedora 22/21, CentOS/RHEL 7.1/6.7/5.11

1. Change Root User

2. Get Adobe Reader RPM package

0
1
2
3
4
5

 
## English version ##
wget http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i486linux_enu.rpm

 

3a. Install Adobe Reader (acroread) on Fedora 22/21/20/19

Note: On x86_64 bit system, 32-bit dependencies is also installed.

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
## Fedora 22 ##
## English version ##
dnf install AdbeRdr9.5.5-1_i486linux_enu.rpm
 
## Install other needed packages on Fedora ##
dnf install nspluginwrapper.i686 libcanberra-gtk2.i686 adwaita-gtk2-theme.i686 PackageKit-gtk3-module.i686
 
 
## Fedora 21/20/19/18/17/16/15/14/13/12 ##
## English version ##
yum localinstall AdbeRdr9.5.5-1_i486linux_enu.rpm
 
## Install other needed packages on Fedora ##
yum install nspluginwrapper.i686 libcanberra-gtk2.i686 adwaita-gtk2-theme.i686 PackageKit-gtk3-module.i686
 
 

3b. Install Adobe Reader (acroread) on CentOS/Red Hat (RHEL) 7

Note: On x86_64 bit system, 32-bit dependencies is also installed.

0
1
2
3
4
5
6
 
## Install nux-dextop repo ##
yum  localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
 
## English version ##
yum –enablerepo=nux-dextop localinstall AdbeRdr9.5.5-1_i486linux_enu.rpm
 

 

3c. Install Adobe Reader (acroread) on CentOS 6.7 and Red Hat (RHEL) 6.7

Note: On x86_64 bit system, 32-bit dependencies is also installed.

0
1
2
3
4
5
6
 
## English version ##
yum localinstall AdbeRdr9.5.5-1_i486linux_enu.rpm
 
## Install other needed packages on CentOS / Red Hat (RHEL) ##
yum install nspluginwrapper.i686 libcanberra-gtk2.i686 gtk2-engines.i686 PackageKit-gtk-module.i686
 
 

3d. Install Adobe Reader (acroread) on CentOS 5.11 and Red Hat (RHEL) 5.11

Note: On x86_64 bit system, 32-bit dependencies is also installed.

0
1
2
3
 
## English version ##
yum localinstall AdobeReader_enu nspluginwrapper.i686
 
 

4. Start Adobe Reader (acroread)

Find Adode Reader on “Office Menu”.
Or
Start Adobe Reader with following command.

0
1
2
 
acroread
 

 

5. Install Adobe Reader (Acrobat PDF Reader) Browser Plugin

This is not currently working on CentOS 7.

Simplest way is copy nppdf.so to browser plugins directory:

0
1
2
3
4
5
6
 
## 32-bit system ##
cp /opt/Adobe/Reader9/Browser/intellinux/nppdf.so /usr/lib/mozilla/plugins/
 
## 64-bit system ##
cp /opt/Adobe/Reader9/Browser/intellinux/nppdf.so /usr/lib64/mozilla/plugins/
 

 

How to install the Java Runtime Environment from Java.com

If a browser plugin and Java runtime are all that is required, as opposed to a full Java development environment, the Oracle (formerly Sun) Java Runtime Environment (JRE) RPMs work for all currently supported CentOS versions, and are arguably the most compatible with web pages that require a Java plugin. The Java versions shown below are current as of this writing. Always use the latest available version for your architecture (i386 32-bit or x86_64/amd64 64-bit) and adjust accordingly.

Java 1.7 and Java 1.8 are now available, while Java 1.6 has been deprecated. However the same procedure as below can be used with any of them. The only difference is that the new versions are distributed directly as a rpm package so instead of the shell command which unpacks and installs the ".bin" package, simply use yum to install the downloaded rpm package, just as you would install any other rpm; for instance: yum install ./jre-8u11-linux-i586.rpm

 

Java i386 JRE and plugin

Due to the way the libraries bundled in the package were built, the browser plugin included in Java 1.7 >= 1.7.0.65 no longer works on CentOS 5. The package can be sucessfully installed but firefox will not enable the plugin due to missing GLIBC symbols. Please use the plugin from Java 1.8 instead.

Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-i586-rpm.bin, from java.com then as root install and configure the alternatives system and plugins.

 

# cd [download directory]
# sh ./jre-6u30-linux-i586-rpm.bin
# alternatives --config java
There are 2 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
Enter to keep the current selection[+], or type selection number:

Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) – For example, if 2 versions were installed then:

 

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3
# alternatives --config java
There are 3 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   3           /usr/java/latest/bin/java
Enter to keep the current selection[+], or type selection number: 3
# java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.

 

# cd /usr/lib/mozilla/plugins/
# ln -fs /usr/java/latest/lib/i386/libnpjp2.so

Skip to the section on testing the browser plugin.

 

Java x86_64 JRE and plugin

Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-x64-rpm.bin, from java.com then as root install and configure the alternatives system and plugins:

 

# cd [download directory]
# sh ./jre-6u30-linux-x64-rpm.bin
# alternatives --config java
There are 4 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /usr/java/jre1.6.0_13/bin/java
   3           /usr/java/jre1.6.0_18/bin/java
*+ 4           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
Enter to keep the current selection[+], or type selection number:

Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) – For example, if 4 versions were installed then:

 

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 5
# alternatives --config java
There are 5 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /usr/java/jre1.6.0_13/bin/java
   3           /usr/java/jre1.6.0_18/bin/java
*+ 4           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   5           /usr/java/latest/bin/java
Enter to keep the current selection[+], or type selection number: 5
# java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_30)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.

 

# cd /usr/lib64/mozilla/plugins/
# ln -fs /usr/java/latest/lib/amd64/libnpjp2.so

 

Test browser

Exit Firefox if it is running and [re]start Firefox. Type "about:plugins" in the URL field. It should show Java enabled.

Verify installed version at Java.com, Test installed version at Java.com or at javatester.org.

 

Remove old versions

Oracle recommends removing old Java versions as they represent a security risk if left installed. By default, the installation procedure above will not remove old versions so we must do this manually:

 

# rpm -qa jre\*
jre-1.6.0_13-fcs.x86_64
jre-1.6.0_18-fcs.x86_64
jre-1.6.0_30-fcs.x86_64
# rpm -e jre-1.6.0_18-fcs.x86_64 jre-1.6.0_13-fcs.x86_64

 


 

  • Java is a trademark of the Oracle Corporation.

 


 

  • This page created and maintained by PhilSchaffner. Other Wiki contributors are invited to make corrections, additions, or modifications.

HowTos/JavaRuntimeEnvironment (last edited 2014-08-05 13:18:58 by ManuelWolfshant)

How to setup multimedia on CentOS 7

You will need to also install the EPEL repository as nux-dextop depends on this for some of its packages.

Step 1: Install the nux-dextop repository

Run this command to install the nux-dextop repository.

yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Step 2: Install the adobe repository

Run this command to install the adobe repository.

yum -y install http://linuxdownload.adobe.com/linux/x86_64/adobe-release-x86_64-1.0-1.noarch.rpm

Step 3: Install the desired packages

This command will download the flash plugin for Firefox.

yum install flash-plugin

This command will download the java plugin for Firefox.

yum install icedtea-web

This command will install Handbrake, VLC and smplayer.

yum install vlc smplayer ffmpeg HandBrake-{gui,cli}

The following command installs a decoder and codecs which are required to play certain types of media. Their usage may be legally restricted in some areas. Obtain legal advice if you are uncertain about the laws in your locality.

yum install libdvdcss gstreamer{,1}-plugins-ugly gstreamer-plugins-bad-nonfree gstreamer1-plugins-bad-freeworld

Final note

Notice that you have the CentOS, Nux-Dextop and Adobe repos enabled by default and there should be no issues with running "yum update" or "yum upgrade" in the future.

Credits -> TipsAndTricks/MultimediaOnCentOS7 (last edited 2014-10-23 15:25:55 by TrevorHemsley)

How to Choose a Partition Scheme for Your Linux PC

What Are Partitions?

Partitions are divisions in the formatting of the hard disk.  It’s a logical – as opposed to a physical – division, so you can edit and manipulate them for various purposes.  Think breaking a disk into two configuration parts.  Partitions are really handy because they act as a sandbox.  If you have a 1 TB hard drive partitioned into a 250 GB partition and a 750 GB partition, what you have on the latter will not affect the other, and vice versa.  You can share one of those partitions on the network and never worry about people accessing information on the other.  One could have Windows installed, riddled with viruses and trojans.  The other could be running a very obsolete, security-hole addled Linux installation.  Never shall the two interfere, unless either you make them or the hard drive itself physically dies.

The other useful thing is that you can have multiple partitions, each formatted with a different “file system.”  A file system is a formatting of the disk into a table that the operating system can read, interpret, and write to.  Only have one hard drive?  That’s okay, because you can still install multiple operating systems on it without actually having another physical disk.

While there are tons of file system types, there are only three kinds of partitions: primary, extended, and logical.  Any given hard disk can only have a maximum of four primary partitions.  This limitation is due to something called the Master Boot Record which tells the computer which partitions it can boot from, and so primary partitions are usually reserved for operating systems.  But what if we want more than four?  That’s where the extended partition comes into play.  It serves as a hollow container for any number of smaller, logical partitions.  You can make as many as you like there, as well as make it home to your non-OS sections.

If extended partitions are so great, why not just use them?  That’s because you can’t directly boot from anywhere inside an extended partition.  There are ways to get around this, but the best thing to do is to plan properly beforehand with primary partitions.  In addition, the way partitions are numbered by the system depends on these types.  First, the machine will number based on all primary partitions, and then by logical ones.  This can cause changing drive letters if you switch between OSs or add or delete partitions later.

Mount Points in Linux

partition scheme (methoddan)

Image by MethodDan

On Windows, things are pretty clearly cut: it lives on your disk, usually on one partition, and that’s that.  If you have other drives, and they have a compatible file system, then it’ll read them as well.  If not, it’ll usually ignore them, or offer you the ability to reformat.  Linux – and anything resembling Unix, really – doesn’t quite work that way.

The way Linux works is that it puts everything onto a tree.  If you have another partition or disk, it gets “mounted” as a branch in a specific folder, usually /media or /mnt.  The directory that a partition gets mounted to is called a “mount point.”  This method works better with Linux’s tree structure, and you can mount partitions as folders nearly anywhere.  In Windows, this is not so easily done; new partitions generally show up as separate drives.  In addition, Linux can work with many more types of file systems natively than Windows.

Remember how there could only be four primary partitions?  If you want to boot 145 OSs like someone on the JustLinux forums did, you can set up a primary partition for /boot, which houses a boot-loader, like GRUB or LiLo, which handles initial functions and then continues booting into the extended partitions.

What Scheme Should I Use?

The standard partitions scheme for most home Linux installs is as follows:

  • A 12-20 GB partition for the OS, which gets mounted as / (called “root”)
  • A smaller partition used to augment your RAM, mounted and referred to as swap
  • A larger partition for personal use, mounted as /home

The exact size requirements change based on your needs, but in general you start with swap.  If you do a lot of multimedia editing, and/or have a smaller amount of RAM, you should use a larger amount of swap.  If you have plenty of memory, you can skimp on it, although some distributions of Linux have a problem going into standby or hibernating without much swap.  The rule of thumb is that you choose between 1.5 to 2 times the amount of RAM as the swap space, and you put this partition in a place that is quick to reach, like at the beginning or end of the disk.

Even if you install a ton software, a maximum of 20 GB for your root partition should be enough.  Most distributions of Linux use either ext3 or ext4 as their file system nowadays, which has a built-in “self-cleaning” mechanism so you don’t have to defrag.  In order for this to work best, though, there should be free space for between 25-35% of the partition.

Finally, whatever else you have should go to your /home partition.  This is where your personal stuff is stored. It is functionally the equivalent of the “Users” directory in Windows, housing your application settings, music, downloads, documents, etc, and those of any other users you have on your system.  It’s useful to have /home in a separate partition because when you upgrade or reinstall your OS, you don’t have to backup anything in this folder!  Isn’t that convenient?  To top it off, most of your program- and UI-related settings are saved as well!

Screenshot-Install

If you’re running a server with a lot of users and/or a lot of media, you could optimize performance by using two hard drives.  A small solid state drive would be perfect for the OS to live on, maybe 32 GB at most, and you could throw the swap partition on the beginning of a 1 or 2 TB “green” drive that’s mounted on /home.

If you’re into more tinkering, you can even set up different partitions for things like the temporary directory (/tmp), for your web server’s content (/var/www), for programs (/usr), or for log files (/var/log).

Specifying Mount Points During Installation

In our example, we’ll be using showing the partition setup during an Ubuntu Maverick Meerkat installation.  When you get to where it says “Allocate drive space,” choose “Specify partitions manually (advanced).”

installation manual

 

Don’t panic just because you see “advanced”; it’s really not that difficult and you’ll be getting some real rewards from the process.  Click forward and you’ll see the partition table.

new partition

Click on the free space row in the table and then click on “Add…”  If you don’t have free space, click on your Windows partition, hit “Change…” and shrink it to a more palatable size.  This will give you some free space to work with.

Create partition

Here, you can see that I’ve created a Primary partition of about 11.5-odd GB at the beginning of the disk and I’ve specified it to use root as the mount point.  You will have to use a Linux-compatible file system, so I used the default ext4, although you can use ext2, ext3, ReiserFS, or whatever else.  Do some research online and you’ll be able to choose the best, but if you’re in doubt, stick to the default.  You can adjust yours to more space if you have it, but again, you probably won’t ever need more than 20 GB unless you’re installing/compiling a lot of software.  Click “OK” and you’re set to create another partition.

swap

This time, as you can see, I’ve chosen a logical partition (the partitioning program automatically creates an extended partition for this).  Since this machine has a 512 MB of RAM, I’ve approximated 1.5 times that, and designated it as “swap area.”  Also note that I’ve stuck this at the end of the disk, which will help keep disk seeking times at a minimum.  Click “OK,” and let’s create another partition.

home

I’ve selected all of the rest of the space in the middle to be my /home partition.  The compatible file system I’ve chosen is again ext4.  Now here is the gray area: should it be primary or logical?  I went with primary because I know that I won’t be installing another OS on here, otherwise I would have gone with logical.  If you don’t plan on installing more than three OSs, you can just make it primary for simplicity’s sake.

When you’re all finished, you can resume installation.  Here’s my resulting partition table:

finished!

If you get cold feet, you can quit the installation at this point without fearing any data loss.  Nothing is actually done to your disk until you hit “Install Now,” so you can go back and edit things as you wish.


Now that you know what partitions are and how to optimally set up your Linux installation, feel free to continue your search online.  There’s a lot more to learn!  Have any advice or tricks to the process?  Maybe some useful experiences to share?  Be sure to leave a comment!

 

Credits

Tip for significantly increasing battery life / reducing power consumption (Thinkpad X220)

The biggest win was setting i915.i915_enable_rc6=1 on the kernel command 
line, although I've read that this can cause some instability, depending 
on you kernel and usage -- had a couple of crashes/freezes a 6 months 
ago, but it seems pretty stable now.  The benefits for a laptop 
definitely out-weigh the inconvenience or a few rare freezes, but it 
would be different for a server.

Might try out the other kernel line options and see if I can do better :-)

Here's my /etc/rc.d/rc.local file in case you are interested:
-------------------------------------
#!/bin/bash

echo 5 > /proc/sys/vm/laptop_mode
echo 0 > /proc/sys/kernel/nmi_watchdog
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
for i in /sys/bus/usb/devices/*/power/level; do echo auto > $i; done
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
for i in /sys/bus/{pci,i2c}/devices/*/power/control; do echo auto > $i; done

iwconfig wlan0 power on

Credits

CentOS 7 Tips

Newer kernel can improve random read and write IO by 25% – 50% in some cases, at least if you are utilizing SSD storage, or use this "cloud" thing called KVM. This performance boost comes from the newish blk-mq update to the Linux block device subsystem. To upgrade CentOS from Kernel 3.10.x to 3.17.x do the following: '''note: you may need to change the minor versions as the kernel is updated, so if copypasta doesn't work, please make sure you are replacing the versions in the commands with the correct version''' Get the key and install the repo so we can has the access to latest centos kernels. You should make sure there isn't a newer version of elrepo before you copypasta these commands. That should help to ensure you always get the latest kernel for CentOS 7. Keep in mind that removing the stock kernel will set you adrift from the rest of the boring and slow CentOS world, which is ok with me, but it might not be ok with your boss so I'm just giving you a fair warning.

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm 

Remove the old CentOS 7 kernel tools, headers and libs, in the case of CentOS 7 we are removing the 3.10 Kernel and replacing with the 3.17 kernel. I don't really suggest doing this on a production server, at least until you have finalized everything and are happy with the results. You already knew that though, right? 🙂

yum remove kernel-headers-3.10.0-123.9.2.el7.x86_64 kernel-tools-3.10.0-123.9.2.el7.x86_64 kernel-tools-libs-3.10.0-123.9.2.el7.x86_64

*http://elrepo.org/tiki/tiki-index.php Edit repo and set "enabled=" in the kernel section to "1" to enable access to the latest kernel

vim /etc/yum.repos.d/elrepo.repo

[elrepo-kernel]
name=ELRepo.org Community Enterprise Linux Kernel Repository - el7
baseurl=http://elrepo.org/linux/kernel/el7/$basearch/
        http://mirrors.coreix.net/elrepo/kernel/el7/$basearch/
        http://jur-linux.org/download/elrepo/kernel/el7/$basearch/
        http://repos.lax-noc.com/elrepo/kernel/el7/$basearch/
        http://mirror.ventraip.net.au/elrepo/kernel/el7/$basearch/
mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

Update Yum so that CentOS 7 pulls the newer 3.17 kernel packages from the repo we just installed.

yum update

Install the new 3.17 kernel and it's packages / libraries / tools, you might see a different kernel version than the one talked about here, so you may need to slightly modify the rest of these steps.

yum install kernel-ml.x86_64 kernel-ml-devel.x86_64 kernel-ml-headers.x86_64 kernel-ml-tools.x86_64 kernel-ml-tools-libs.x86_64 kernel-ml-tools-libs-devel.x86_64

Verify the latest kernel is available by running the following command which will parse grub2.cfg and output the available kernels to boot from

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg


CentOS Linux, with Linux 3.17.1-1.el7.elrepo.x86_64
CentOS Linux, with Linux 3.10.0-123.el7.x86_64
CentOS Linux, with Linux 3.10.0-123.9.2.el7.x86_64
CentOS Linux, with Linux 3.10.0-123.8.1.el7.x86_64
CentOS Linux, with Linux 0-rescue-8a06d0a454c348f5911cbf876baa0e02
CentOS Linux Memtest memtest86+-4.20

If the CentOS kernel version 3.17.x is listed first, then set grub to use 0 which will set the system to boot off the newer kernel. You might want to leave some of the older 3.10.x kernels on the system in case you decide to revert to the stock CentOS 7 kernel, but you can always modify the default kernel to use later on.

grub2-set-default 0

Update the grub2 config so it's aware of the changes we just made.

grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot the server and cross your fingers! If all goes well the server should come back online and boot CentOS 7 with the 3.17 kernel

reboot

To see if this is the case, run

uname -a

==Upgrade CentOS 7 Kernel to 4.0.1== Why upgrade CentOS from the stock 3.10.x kernel to a newer 4.0.1.x kernel? '''[http://wiki.mikejung.biz/Category:Performance Performance]''', especially if you use '''[http://wiki.mikejung.biz/KVM_/_Xen KVM]'''. I found that the 3.17 kernel can improve random read and write IO by 25% – 50% in some cases. The Linux 4.0 Kernel builds on top of all the previous performance gains found in the 3.17 kernel. To upgrade CentOS from Kernel 3.10.x to 4.0.1 do the following: ' Get the key and install the repo so we can has the access to latest centos kernels. You should make sure there isn't a newer version of elrepo before you copypasta these commands. That should help to ensure you always get the latest kernel for CentOS 7. Keep in mind that removing the stock kernel will set you adrift from the rest of the boring and slow CentOS world, which is ok with me, but it might not be ok with your boss so I'm just giving you a fair warning.

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm 

Remove the old CentOS 7 kernel tools, headers and libs, in the case of CentOS 7 we are removing the 3.10 Kernel and replacing with the 4.0.1 kernel. I don't really suggest doing this on a production server, at least until you have finalized everything and are happy with the results. You already knew that though, right? 🙂

yum remove kernel-headers-3.10.0-123.9.2.el7.x86_64 kernel-tools-3.10.0-123.9.2.el7.x86_64 kernel-tools-libs-3.10.0-123.9.2.el7.x86_64

*http://elrepo.org/tiki/tiki-index.php Edit repo and set "enabled=" in the kernel section to "1" to enable access to the latest kernel

vim /etc/yum.repos.d/elrepo.repo

[elrepo-kernel]
name=ELRepo.org Community Enterprise Linux Kernel Repository - el7
baseurl=http://elrepo.org/linux/kernel/el7/$basearch/
        http://mirrors.coreix.net/elrepo/kernel/el7/$basearch/
        http://jur-linux.org/download/elrepo/kernel/el7/$basearch/
        http://repos.lax-noc.com/elrepo/kernel/el7/$basearch/
        http://mirror.ventraip.net.au/elrepo/kernel/el7/$basearch/
mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

Update Yum so that CentOS 7 pulls the newer 4.0.1 kernel packages from the repo we just installed.

yum update

Install the new 4.0.1 kernel and it's packages / libraries / tools, you might see a different kernel version than the one talked about here, so you may need to slightly modify the rest of these steps.

yum install kernel-ml kernel-ml-headers kernel-ml-tools kernel-ml-tools-libs kernel-ml-tools-libs-devel

If the CentOS kernel version 4.0.1 is listed first, then set grub to use 0 which will set the system to boot off the newer kernel. You might want to leave some of the older 3.10.x kernels on the system in case you decide to revert to the stock CentOS 7 kernel, but you can always modify the default kernel to use later on.

grub2-set-default 0

Update the grub2 config so it's aware of the changes we just made.

grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot the server and cross your fingers! If all goes well the server should come back online and boot CentOS 7 with the 4.0.1 kernel

reboot

== Activate tuned latency-performance for CentOS 7== Tuned should already be installed for Cent 7, and the default profile is balanced. Depending on what you are doing, you may see better '''[http://wiki.mikejung.biz/Performance_Analysis performance]''' by changing the profile to "latency-performance". Please note that if you use "tuned-adm" you are enabling a static profile which is different than running the "tuned" dynamic daemon which will analyze historical performance data and attempt to tune the server's settings on the fly. Personally I don't used the daemon, but I wanted to mention there is a dynamic "tuned" daemon, as well as a static "tuned-adm" utility which is a one off config changer.

tuned-adm profile latency-performance

To see what the active profile is:

tuned-adm active

For more information on tuned-adm options, check out the man page.

man tuned-adm

*'''latency-performance''' — "Profile for low latency performance tuning. Disables power saving mechanisms. CPU governor is set to performance and locked to the low C states (by PM QoS). CPU energy performance bias to performance." This profile is the Parent profile to "network-latency". For CentOS 7, the latency-performance profile includes the following tweaks

force_latency=1
governor=performance
energy_perf_bias=performance
min_perf_pct=100
kernel.sched_min_granularity_ns=10000000
vm.dirty_ratio=10
vm.dirty_background_ratio=3
vm.swappiness=10
kernel.sched_migration_cost_ns=5000000

*'''network-latency''' — This is a Child profile of "latency-performance". That this means is that if you were to activate network-latency profile via tuned, it would automatically enable latency-performance, then make some additional tweaks to improve network latency. As you can see, the network-latency profile includes "latency-performance", however it also disables transparent hugepages, and makes some net.core kernel tweaks. '''Please note:''' network-latency disables Cent 7's automatic NUMA balancing, so if you are not manually pinning processes to nodes, then you might actually see some reduced performance by enabling network-latency.

include=latency-performance
transparent_hugepages=never
net.core.busy_read=50
net.core.busy_poll=50
net.ipv4.tcp_fastopen=3
kernel.numa_balancing=0

*'''throughput-performance''' — This is the Parent profile to virtual-guest, virtual-host and network-throughput. This profile is optimized for large, streaming files or any high throughput workloads. *'''virtual-guest''' — "Profile optimized for virtual guests based on throughput-performance profile. It additionally decreases virtual memory swapiness and increases dirty_ratio settings." *'''virtual-host''' — "Profile optimized for virtual hosts based on throughput-performance profile. It additionally enables more aggressive write-back of dirty pages." tuned-adm profiles can be found in this directory

/usr/lib/tuned/

To learn more about each profile you can navigate to the profile directory and take a look at the profile's tuned.conf which shows what tweaks are done. The 3 most common profiles seem to be the virtual-guest, virtual-host, and latency-performance profiles. There is a "balanced" profile, but if you are running a server you will almost always want to set "latency-performance" unless you are running a storage node that deal with large, streaming files, in that case "throughput-performance" might make more sense. CentOS 7 is pretty smart about picking a profile to use when it starts up. If CentOS 7 is run as a guest using '''[http://wiki.mikejung.biz/KVM_/_Xen KVM]''', then you may see that the virtual-guest profile is active. If you are using CentOS 7 to run KVM on, and to host guests then you might see that the profile for virtual-host is active. Personally I prefer to use '''latency-performance''' profile most of the time because it really does seem to boost random read IO at the expense of slightly lower random writes (100 – 200 iops slower than virtual-guest) , and help improve overall CPU performance, at least that's what I've found when I '''[http://wiki.mikejung.biz/Benchmarking benchmark]''' servers using '''[http://wiki.mikejung.biz/Sysbench Sysbench]'''. In general you will almost always see a 1.5x – 2x performance boost for random reads if you are using SSD backed storage. == CentOS 7 RPM commands and options== ===How to search and view specific rpm packages on CentOS 7=== To search for available packages on CentOS 7 you can use the yum search command

yum search $example

Find all packages installed on CentOS 7

rpm -qa 

Find all MySQL RPM packages installed on CentOS 7 you can pipe the output of -qa to grep and use -i to match upper and lower case. If you want to find all mysql related rpms use the command below.

rpm -qa | grep -i mysql

=== List all files in RPM package === Simply run this command against any RPM you want to inspect.

rpm -qlp $package.rpm

Here is an example of the output.

rpm -qlp MySQL-shared-compat-5.1.49-1.rhel5.x86_64.rpm

/usr/lib64/libmysqlclient.so
/usr/lib64/libmysqlclient.so.12
/usr/lib64/libmysqlclient.so.12.0.0
/usr/lib64/libmysqlclient.so.14
/usr/lib64/libmysqlclient.so.14.0.0
/usr/lib64/libmysqlclient.so.15
/usr/lib64/libmysqlclient.so.15.0.0
/usr/lib64/libmysqlclient.so.16
/usr/lib64/libmysqlclient.so.16.0.0
/usr/lib64/libmysqlclient_r.so
/usr/lib64/libmysqlclient_r.so.12
/usr/lib64/libmysqlclient_r.so.12.0.0
/usr/lib64/libmysqlclient_r.so.14
/usr/lib64/libmysqlclient_r.so.14.0.0
/usr/lib64/libmysqlclient_r.so.15
/usr/lib64/libmysqlclient_r.so.15.0.0
/usr/lib64/libmysqlclient_r.so.16
/usr/lib64/libmysqlclient_r.so.16.0.0

=== Extract RPM packages Using rpm2cpio === Create a new directory, then copy over the RPM into that directory. Then run this command to extract the files into your directory.

rpm2cpio MySQL-shared-compat-5.1.49-1.rhel5.x86_64.rpm | cpio  -idmv
./usr/lib64/libmysqlclient.so
./usr/lib64/libmysqlclient.so.12
./usr/lib64/libmysqlclient.so.12.0.0
./usr/lib64/libmysqlclient.so.14
./usr/lib64/libmysqlclient.so.14.0.0
./usr/lib64/libmysqlclient.so.15
./usr/lib64/libmysqlclient.so.15.0.0
./usr/lib64/libmysqlclient.so.16
./usr/lib64/libmysqlclient.so.16.0.0
./usr/lib64/libmysqlclient_r.so
./usr/lib64/libmysqlclient_r.so.12
./usr/lib64/libmysqlclient_r.so.12.0.0
./usr/lib64/libmysqlclient_r.so.14
./usr/lib64/libmysqlclient_r.so.14.0.0
./usr/lib64/libmysqlclient_r.so.15
./usr/lib64/libmysqlclient_r.so.15.0.0
./usr/lib64/libmysqlclient_r.so.16
./usr/lib64/libmysqlclient_r.so.16.0.0
22600 blocks

== Install EPEL Repo CentOS 7 == Please make sure you are downloading the latest release for EPEL as it gets updated frequently. As of January 19th 2015, the latest EPEL release is 7-5 but before use the commands below, check out this link to make sure you wget the latest release! http://mirrors.liquidweb.com/fedora-epel/7/x86_64/repoview/epel-release.html All you need to do is grab the rpm and install it, then update yum and you should be all set.

wget http://mirrors.liquidweb.com/fedora-epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -iv epel-release-7-5.noarch.rpm
yum update

== How to view all installed rpms on centos 7 == You can use rpm -qa to view all of the currently installed rpms on centos 7

rpm -qa

== How to install NOVM on CentOS 7 == *https://github.com/google/novm To make and run novm on CentOS 7 do the following

yum install go fakeroot
git clone https://github.com/google/novm.git
cd novm/
make

To make an RPM of novm on CentOS 7 do the following

yum install go fakeroot
git clone https://github.com/google/novm.git
cd novm/
make rpm
rpm -iv novm-0.0-164.gb7c9c78.x86_64.rpm

If you get the error "bin/sh: gofmt: command not found" when attempting to run the make command, then you should make sure GO is installed, once that is the case the make command should build novm successfully. After you make novm you can find two binaries under the bin directory where you built novm.

/novm/bin/

noguest
novmm

novmm command line options

Usage of ./novmm:
  -cmdline="": linux command line
  -controlfd=-1: bound control socket
  -debug=false: devices start debugging
  -init=false: real in-guest init?
  -initrd="": initial ramdisk image
  -paused=false: start with model and vcpus paused
  -setup="": linux boot params (vmlinuz)
  -statefd=0: machine state file
  -step=false: step instructions
  -stop=false: wait for a SIGCONT before running
  -sysmap="": kernel symbol map
  -trace=false: trace kernel symbols on exit
  -vmlinux="": linux kernel binary (ELF)

novm noguest command line options

./noguest --help
Usage of ./noguest:
  -control="/dev/vport0p0": control file
  -serverfd=-1: run RPC server

==CPUFreq and CPU Governors == To view what CPUFreq drivers are available for CentOS 7 run this command

ls -1 /lib/modules/`uname -r`/kernel/arch/x86/kernel/cpu/cpufreq/

To load the acpi-cpufreq module run modprobe, if it's already loaded then you can skip this step. Generally speaking you always want to load the '''acpi-cpufreq''' instead of the other CPU freq options, so unless you have a specific reason to load something else, always use acpi-cpufreq. If you are having issues using CPUFreq you might as well make sure it's loaded before trying to troubleshoot too much further.

modprobe acpi-cpufreq

Once the driver is loaded you can install and run cpupowerutils which will let you know what the current frequency of your CPUs is, and what CPU governors are available to be used on your system.

yum install cpupowerutils

cpupower frequency-info --governors

Generally speaking, the performance governor is the best option to use if you are configuring a server that's going to be used all the time. Forcing the CPU governor to run in performance mode can help improve IO and reduce latency in some cases.

cpupower frequency-set --governor performance

For Official RHEL docs please visit this [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Power_Management_Guide/cpufreq_setup.html link] ==How to install FIO on CentOS 7== The easiest way to install FIO on CentOS 7 is to install the lastest version of the EPEL repo, update YUM and then install fio. This will install FIO-2.1.11-1 which appears to be relatively up to date.

wget http://mirrors.liquidweb.com/fedora-epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -iv epel-release-7-5.noarch.rpm
yum update
yum install fio -y

To run a basic '''FIO random write''' test on CentOS 7, use the command below. This uses the "libaio" engine for IO, uses and IO depth of 32, uses file block size of 4KB and runs 8 Jobs, or processes each writing to a 4GB file for a total of 4 minutes, results are then grouped together which basically combines all 8 job results into one overall report summary. Fio is pretty flexible when it comes to displaying output, I suggest you view the fio man page for a list if the filters for the output.

fio --name=randfile --ioengine=libaio --iodepth=32 --rw=randwrite --bs=4k --direct=0 --size=4G --numjobs=8 --runtime=240 --group_reporting

To run a basic '''FIO random read''' test on CentOS 7, use the command below. This uses the "libaio" engine for IO, uses and IO depth of 32, uses file block size of 4KB and runs 8 Jobs, or processes each reading from a 4GB file for a total of 4 minutes, results are then grouped together which basically combines all 8 job results into one overall report summary.

fio --name=randfile --ioengine=libaio --iodepth=32 --rw=randread --bs=4k --direct=0 --size=4G --numjobs=8 --runtime=240 --group_reporting

==How to install Phoronix Test Suite CentOS 7== To install the latest version of Phoronix Test Suite on CentOS 7, run the commands below. Basically we are just installing some dependencies for Phoronix (PHP stuff), grabbing the latest stable generic package, renaming it to something we can extract, extracting the test suite, then running Phoronix's installer script.

yum install php-cli php-xml php-gd php-json -y
wget http://www.phoronix-test-suite.com/download.php?file=phoronix-test-suite-5.4.1
mv download.php\?file\=phoronix-test-suite-5.4.1 phoronix-test-suite-5.4.1.tar.gz
tar zxvf phoronix-test-suite-5.4.1.tar.gz
cd phoronix-test-suite/
./install-sh

Once the installer script completes you can start using Phoronix to test out performance. For example, if you want to run the nginx test you would run this command '''note''' for whatever reason the nginx and sometimes apache test fails to run, I've found that disabling IPV6 fixes the issue, obviously if you use IPV6 then don't do this, but if you get an error run the command below to resolve the issue. The command is just disabling ipv6 in '''[[Sysctl tweaks|sysctl.conf]]'''

echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -p
/usr/bin/phoronix-test-suite benchmark pts/nginx

For more information on Phoronix and available tests, check out this '''[http://wiki.mikejung.biz/Benchmarking#Phoronix_Test_Suite page]'''. == systemctl apache CentOS 7 == To start '''[http://wiki.mikejung.biz/Apache Apache]''' using systemctl

systemctl start  httpd.service

To stop httpd using systemctl

systemctl stop  httpd.service

To restart httpd using systemctl

systemctl restart  httpd.service

==Using Numastat on CentOS 7 == With CentOS 7, numastat has received some updates that make it easier to view memory usage on a per node basis. The updates make numastat's output look more like the output from /proc/meminfo. You can use numastat to determine how much memory each '''[http://wiki.mikejung.biz/NUMA NUMA]''' node is using. Numastat will also show the amount of total NODEs on the server, this can be useful if you are trying to determine if a server / CPU utilizing multiple banks of RAM (like an E5-2690), or if it just uses a single bank of RAM (like an E3-1220). If you use the option "-c" when you run numastat, it will shrink the output based on the data being displayed. This option helps make the output more readable. numastats "-m" makes the memory information appear to be more /proc/meminfo like. "-z" will remove any rows that have no data, cleaning up the output and only displaying relevant information.

numstat -mzcs

CentOS 7 supports automatic NUMA balancing. The kernel is able to detect what memory pages are being used by processes and their threads, then attempts to balance the pages / schedule CPU time on the closest CPU to those memory pages. The idea is to try and get processes to run on the CPU that is the shortest distance from the memory bank. Ideally, data in memory should be processed on the closest CPU to avoid latency, which can significantly slow down a program that is using large amounts of RAM. ==Using lscpu on CentOS 7 == Similar to the numastat utility, you can use lscpu to view advanced CPU information which provides NUMA NODE counts, and information about what CPU / Core uses which NUMA Node. lscpu is part of the util-linux package, you can install this on CentOS 7 by using yum.

yum install util-linux

To run lscpu you can simply run lscpu!

lscpu

Credits

Tweaking CentOS 7

I’ve been a happy CentOS user ever since version 6.3. CentOS and Debian are two linux flavours that I have been playing around with since past few weeks and found both to be amazingly stable and smooth.

Ever since CentOS 7 came out, I was itching to try it. I’m a regular reader of dedoimedo’s linux musings. That guy has been writing awesome articles after articles on Linux apart from other topics. His article on CentOS 6 made me try it out so I was waiting for his take on CentOS 7. His first article seemed that he had tried it a bit too early so I thought it’s better to wait and watch. His second article – CentOS 7 – The perfect desktop guide is what got me going.

There are quite a few useful repos mentioned in the guide. The real cherry on the cake though, is nux’s CentOS 7 Repo. It’s got a lot of useful stuff. Really useful stuff that matters.

He is the creator of Stella Linux which is simply the most amazing Linux Distro. It’s a remix of CentOS (That’s how nux prefers to call it). It’s awesome.

Ok. Let’s start tweaking CentOS 7. One note before we start. I had selected the “Development and Creative Workstation” option from the Software Selection Section so that it would automatically install a lot of packages during installation itself. You might need to install other packages if you have selected any other option.

First off, as given in the guide above, run the update command:

Note – You’ll have to run all the commands as root.

yum update

Reboot and check if all looks fine.

Install the epel, elrepo and the nux repository. I had the epel repo pre installed so shown below are steps to install the elrepo and nux repositories only.

 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
 rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
 rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Run the yum update command once again.

Note – Please check for the latest packages before you run the commands. As pointed out by Ruud de Bruin, the Nux Repo link is updated. Thanks Ruud.

The very next thing I did was installed the latest kernel-ml from Nux’s repo. That’s because with the stock kernel I was having issues toggling screen brightness and after some googling around I had found that 3.16.2 fixes that and few other issues (while on Stella Linux 6.5). So off I went installing it.

 yum --enablerepo=elrepo-kernel install kernel-ml

That gave me kernel version 3.16.2. So I rebooted once again, selected the kernel version 3.16.2 and all fine and dandy after that. Brightness toggle works perfectly. System boots a little faster as well.

The fonts appeared fuzzy. Well, a good .fonts.conf file should solve that. I had one lying around since my last tryst with Debian. This is an exact copy of what I found on the Debian Forum. It had worked well on Stella Linux 6.5 (Which is a remix of CentOS 6.5). Here’s the content of that file.

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
     <match target="font">
      <edit mode="assign" name="hinting" >
       <bool>true</bool>
      </edit>
     </match>
     <match target="font" >
      <edit mode="assign" name="autohint" >
       <bool>true</bool>
      </edit>
     </match>
     <match target="font">
      <edit mode="assign" name="hintstyle" >
      <const>hintslight</const>
      </edit>
     </match>
     <match target="font">
      <edit mode="assign" name="rgba" >
       <const>rgb</const>
      </edit>
     </match>
     <match target="font">
      <edit mode="assign" name="antialias" >
       <bool>true</bool>
      </edit>
     </match>
     <match target="font">
       <edit mode="assign" name="lcdfilter">
       <const>lcddefault</const>
       </edit>
     </match>
    </fontconfig>

I copied this to my home folder. Remember, the name of the file has to be .fonts.conf. Notice the “.” at the beginning. It has to be in your home folder. So say, your home folder is at /home/yourname, then you’ll need to ensure that you copy the file in that location.

[pmu@localhost ~]$ pwd
/home/pmu
[pmu@localhost ~]$ ls -a | grep ".fonts.conf"
.fonts.conf
[pmu@localhost ~]$

Logged out and logged back in. The application and browser fonts were much better now. But for best effects, we’ll install infinality. It really makes a huge difference. And this is where nux’s repo comes in. He has done all the hard work already. We just need to install the packages like so:

 yum --enablerepo=nux-dextop install fontconfig-infinality
 yum --enablerepo=nux-dextop install cairo
 yum --enablerepo=nux-dextop install libXft
 yum --enablerepo=nux-dextop install freetype-infinality

Rebooted once again. And man, I could tell the difference. The fonts were amazingly clear. Way better even than on Windows.

Here’s some screen shots:

Section of a page.

Section of a page.

google search page screenshot

libreoffice

Download Window Screenshot. Check out the beautiful fonts.

Download Window Screenshot. Check out the beautiful fonts.

Adobe's full page

Adobe’s full page

Tweak Tool Screenshot that shows my chosen Fonts Settings.

Tweak Tool Screenshot that shows my chosen Fonts Settings.

That's how my vim looks in CentOS 7

Vim with a few tweaks.

The second last screenshot here shows the changes I have done to some default fonts. CentOS 7 looks way snappier to me this way. Like I said earlier, The fonts were amazingly clear. Way better even than on Windows. No kidding.Windows…heck, I needed to install the packages so that I could mount my USB Disks that are NTFS partitioned.

 yum install ntfs*

Okie….Did that, and was able to access my windows partitions without any problems.

Now we’ll install sensors package so that I’d know how’s the laptop temperature doing:

 yum install lm_sensors

And configure it as a root by running the following command and selecting the answers to the interactive questions.

sensors-detect

Though I like the default adwaita theme, the icons could be really better. Once again the nux repos come to the rescue.

yum --enablerepo=nux-dextop install faience-icon-theme

Select the theme in the Tweak Tool as shown below:

select_icon_theme

Now the icons look much much better.

icons

myhome

I left out the touchpad settings. Here’s how we go about it.

Hit the “Windows” key, and you’ll get a screen like this.

type_here

Now type the word “touchpad” (without quotes)

touchpad

Click on that option and then change the setting the way you want.

This is how my settings look:

mouse_settings

I have enabled the “Two Finger Scroll” and most importantly the “Tap to click” option.

That’s it (for now). We are done. All thanks to dedoimedo and nux, I got a snappy looking CentOS 7 running right now. Infact I wrote this blog on CentOS 7.

As mentioned earlier, I was a happy camper with CentOS 6.5 (Stella Linux actually). Then CentOS 7 came around and curiosity got better of me. I was able to install and tweak it to my liking as given in my Tweaking CentOS 7 post, yet one thing bothered me ~ It didn’t offer the dual boot option that CentOS 6.5 had.

Or so I thought.

A little googling, and I was able to dual boot CentOS 7 and Windows 7 !!

Here’s the points to note before you try this.

1) I am NOT using UEFI. My laptop (A Thinkpad T430) boots using the good old way of booting..the (now legacy) BIOS.

2) I had Windows 7 pre installed before installing CentOS 7. If you install CentOS 7 (Or any other Linux, or any other UNIX like OS for that matter) and then install Windows 7, then Windows 7 will overwrite the earlier entries. So you have to install Windows first.

3) I had freed up some space from the Windows Partition and installed CentOS 7 on that partition. There are a lot of guides on the net that would show you how to go about this. Follow them carefully. As always, back up your data, create a system image first and then proceed.

Now, before you run the commands given below, please go through the points given above.

Done? Good. Now let’s proceed.

I still don’t have a very clear understanding of Grub2, but what has given below has worked. So here we go.

Login as a root by typing su – (note the space between su and the space)

su -

Type in the password. Now you should be at the root prompt.

Now copy the grub.cfg file to another location as shown below ( in my case, I copied it to the root’s home. You can copy it to any place you want.)

cp /boot/grub2/grub.cfg orig.grub.cfg

Now we run the all important command.

grub2-mkconfig -o /boot/grub2/grub.cfg

That’s it. Really. Here’s the output in my case.

[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.16.2-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-3.16.2-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.6.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.6.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-327fe33f3b364802871211321a2790b7
Found initrd image: /boot/initramfs-0-rescue-327fe33f3b364802871211321a2790b7.img
Found Windows 7 (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
done
[root@localhost ~]#

I’ve highligted the Windows lines in a different color just so that they are clearly visible.

The red and bold highlight of the root prompt is due to a setting that I have in my .bashrc of root. We’ll talk about that just in a minute because we need to see if our fiddling has been successful or not. So go ahead and reboot. This time, the Grub Menu will show the entries for Windows. Boot into Windows and see if everything works fine (It should, but then, why not login and check).

Now back to the red root prompt.

Here’s the line that you’ll have to stick at the very end of your .bashrc file in root. Please do be careful.

export PS1="\[$(tput setaf 1)\]\[$(tput bold)\][\u@\h \W]\\$ \[$(tput sgr0)\]"

So after you are done, this is how your .bashrc will look

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
export PS1="\[$(tput setaf 1)\]\[$(tput bold)\][\u@\h \W]\\$ \[$(tput sgr0)\]"

Note – I have highlighted the line so that it’s clearly visible.

Log out and re login as root. You should see a nice bold and red prompt now. 🙂

Here’s where I got it from. Thanks to Noah Petherbridge, I now have a nice root prompt – https://www.kirsle.net/wizards/ps1.html

Credits