标签 centos 下的文章

EPEL(Extra Packages for Enterprise Linux)是由Fedora Special Interest Group 维护的 Enterprise Linux(RHEL、CentOS)中经常用到的包。

What is Extra Packages for Enterprise Linux (or EPEL)?

Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL).

EPEL packages are usually based on their Fedora counterparts and will never conflict with or replace packages in the base Enterprise Linux distributions. EPEL uses much of the same infrastructure as Fedora, including buildsystem, bugzilla instance, updates manager, mirror manager and more.

Learn more about EPEL in the following pages:

Quickstart

You may retrieve signed binary configuration files from one the above two links (varying by the major release number of the installation target machine). They may be automatically installed by root thus:

  • RHEL/CentOS 7:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

  • on RHEL 7 it is recommended to also enable the optional, extras, and HA repositories since EPEL packages may depend on packages from these repositories:
# subscription-manager repos --enable "rhel--optional-rpms" --enable "rhel--extras-rpms" --enable "rhel-ha-for-rhel-*-server-rpms"
  • RHEL/CentOS 8:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  • CentOS Stream 8:
dnf install epel-release
  • on RHEL 8 it is required to also enable the codeready-builder-for-rhel-8-*-rpms repository since EPEL packages may depend on packages from it:
subscription-manager repos --enable "codeready-builder-for-rhel-8-$(arch)-rpms"
  • on CentOS 8 it is recommended to also enable the powertools repository since EPEL packages may depend on packages from it:
dnf config-manager --set-enabled powertools

https://docs.fedoraproject.org/zh_CN/epel/#_quickstart

修改阿里云CentOS Linux服务器的主机名(实例名)

阿里云主机的默认主机名是为AY开头的随机名称,如何修改为易于区分的友好名称呢?请看下面的操作步骤:

vi /etc/hosts

i键,修改主机名,esc键,:x键保存退出

vi /etc/sysconfig/network

i键,修改主机名(HOSTNAME=),esc键,:x键保存退出

输入以下命令:

hostname 新主机名

然后用ssh重新登录,就会显示新的主机名。

在CentOS 6更新后,不可避免的会在启动选项中产生多个内核选项,一个内核文件大概占100兆左右(一般100M以下),可以使用以下命令进行删除多余的内核.

1.首先列出系统中正在使用的内核:

# uname -a

2.查询系统中全部的内核:

# rpm -qa | grep kernel

3.将你想删除的内核删除掉:(例如,在我的系统中,我要删掉2.6.32-71.el6.i686的内核,需要把所有含有2.6.32-71.el6.i686字样的全部删掉)

#yum remove kernel-2.6.32-71.el6.i686
#yum remove kernel-devel-2.6.32-71.el6.i686

4.重启后就可以看到,内核被删掉了,同时多余的启动项也自动被删掉了,不需要自己手动修改/boot/grub/menu.lst