Skip to content

Archive for

26
Mar

Error: Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

If you get this error when running yum update then the problem is that you’ve installed minimal centos with some packages missing. To solve the issue install deltarpm. To see the package name run:

yum provides '*/applydeltarpm'

To install it:

yum install deltarpm
26
Mar

I Want to Keep my CentOS Server Secure. What Should I do?

Supposed you have secure your server, you must also run the following command periodically to keep up with security updates:

yum update

To see security update anouncements visit:

http://lists.centos.org/pipermail/centos-announce/2015-February/thread.html

or subscribe to that mail list.

25
Mar

Where is configured CentOS Base Repository within a CentOS Installation

If you want to modify CentOS Base Repository for a CentOS Linux Installation go to /etc/yum.repos.d and edit CentOS-Base.repo file.

vi CentOS-Base.repo

On that directory there’s also CentOS-Debuginfo.repo, CentOS-Sources.repo and CentOS-Vault.repo.

23
Mar

Find files by partial name in Linux using find command

If you don’t know the whole name of the file you want to find you can use wildcards with find.

So to find the string “filename” in a tree directory structure we will run:

find /path -name '*filename*'

This will search all files that contains “filename” string.

23
Mar

Configure Network in CentOS Linux

This quick tutorial is about configuring the network interface in CentOS Linux.

To configure network in Linux we will edit the following file :

vi /etc/sysconfig/network-scripts/ifcfg-eth0

And add the following lines:

DEVICE=eth0
HWADDR=08:00:27:B0:66:26
TYPE=Ethernet
UUID=d30c8443-148f-4f28-bdc2-4c49529c00f0
ONBOOT=YES
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.0.0.162
NETMASK=255.255.255.0
GATEWAY=10.0.0.1
DNS1=10.0.0.1
DEFROUTE=YES
IPV4_FAILURE_FATAL=no
IPV6INIT=NO

To restart the network run:

/etc/init.d/network restart

or

service network restart

If you want to use DHCP instead of static ip modify line:

BOOTPROTO=dhcp
23
Mar

Find the Version of the CentOS Linux OS Installed on Your Machine

To find the version of your CentOS Linux (or RedHat) distribution run the following command:

cat /etc/*release*
22
Mar

Play with Grub in Centos Linux 7

Check grub version (this works for grub 1):

Grub (version 1)

grub --version

or:

grub-install -v

To change grub options edit /boot/grub/menu.lst

Grub 2

mcedit /etc/default/grub

Generate grub.conf:

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

Edit /etc/default/grub

add:

GRUB_DEFAULT=1
22
Mar

Find files installed by a package in CentOS

In order to find the files that are installed by a particular CentOS package we will first add a package that will help us to accomplish that:

yum install yum-utils

Now to find out what package installs dracut package:

repoquery --list dracut-033-161.el7.x86_64

or

repoquery --list dracut

or

repoquery --list *dracut*
22
Mar

Find What Package Installed a Binary in CentOS Linux

To find what is the package name that installed a specific binary we run (for example we want to know the package name that installs /usr/bin/dracut):

yum whatprovides /usr/bin/dracut

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.pidginhost.com
 * extras: mirrors.pidginhost.com
 * updates: mirrors.pidginhost.com
dracut-033-161.el7.x86_64 : Initramfs generator using udev
Repo        : base
Matched from:
Filename    : /usr/bin/dracut
 
 
dracut-033-161.el7_0.173.x86_64 : Initramfs generator using udev
Repo        : updates
Matched from:
Filename    : /usr/bin/dracut
 
 
dracut-033-161.el7.x86_64 : Initramfs generator using udev
Repo        : @anaconda
Matched from:
Filename    : /usr/bin/dracut
22
Mar

Change the name of a soft raid array created with mdadm in Linux

Let’s say we’ve created a soft raid with mdadm in Linux with name /dev/md0 and we want to change the name to /dev/md1 and make the change permanent.

We will gather some info about drives in the array and the UUID of the array:

mdadm --detail /dev/md0

Write down (copy it somewhere) the UUID and the drive names in the array. Then stop the array.

mdadm --stop /dev/md0

Now recreate the array with the new name (/dev/md1 instead of /dev/md0):

mdadm --assemble /dev/md1 /dev/sd[bc]

Fix the change of name:

edit /etc/mdadm/mdadm.conf

add the following:

ARRAY /dev/md1 UUID=f8f80420:568fcd4c:36437cf0:3fc8c001

Now let’s make the change permanent (if you are on CentOS Linux run):

dracut --force

If you are on Ubuntu run:

sudo update-initramfs -u