Centos

来自智得网
跳转至: 导航、​ 搜索

简介

Centos在开源社区的位置

2003年,Fedora 项目成立,该项目是一个完全开源的社区,是由 Red Hat Linux 及 Fedora Linux 项目合并而成立的,Fedora 成立之初就受到红帽公司的赞助。

2004年,红帽公司发布自己的商业 Linux 发行版本 RHEL。RHEL 使用Fedora 作为上游,但发布周期更长,虽然RHEL仍然提供了开放的源代码,但同时提供收费的商业支持。

同年,CentOS 项目成立,CentOS 是一个社区支持的发行版本,是使用 RHEL 做为上游开发的项目,但是完全开源。

2014年,红帽公司收购了CentOS团队。

2019年,CentOS 团队宣布和红帽合作推出了一个新的滚动版 Linux,CentOS Stream,该发行版的位置位于Fedora和RHEL中间,定位也是RHEL商业版本的滚动测试版本。

2020年,CentOS宣布不再维护CentOS。

centos 8已经于2021年底暂停维护,centos 7也将于2024年停止维护。

特性

使用

包管理

linux下常用的软件安装方式有四种:

  • 可以直接下载通过源代码编译好的二进制包。
  • 通过源代码安装,一般解压之后通过configure,make,make install进行安装。
  • 软件包安装,linux下常用的软件包有软件包有rpm和deb等。
  • 软件包管理工具,软件包管理工具可以自动解决软件包依赖关系,例如yum和apt-get等。

centos使用yum作为软件包管理工具。

centos 8已经暂停维护,所以包管理工具yum也不能正常安装软件。

sh-4.4# yum update
CentOS Linux 8 - AppStream                                                                                                                                                                                                     89  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

所以需要更新一下yum的镜像库地址。

sh-4.4# cd /etc/yum.repos.d/
sh-4.4# 
sh-4.4# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sh-4.4# 
sh-4.4# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
sh-4.4# 
sh-4.4# yum update -y

包管理工具可以查询某个命令所在的包,例如我们使用envsubst命令,但是命令不存在,可以使用下面的方式解决。

sh-4.2# envsubst
sh: envsubst: command not found

sh-4.2# yum provides envsubst
Loaded plugins: fastestmirror, ovl, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
base/7/aarch64/filelists_db                                                                                                                                                                                                   | 6.2 MB  00:00:00     
extras/7/aarch64/filelists_db                                                                                                                                                                                                 | 332 kB  00:00:00     
updates/7/aarch64/filelists_db                                                                                                                                                                                                | 3.1 MB  00:00:00     
gettext-0.19.8.1-3.el7.aarch64 : GNU libraries and utilities for producing multi-lingual messages
Repo        : base
Matched from:
Filename    : /usr/bin/envsubst

sh-4.2# yum install gettext
Loaded plugins: fastestmirror, ovl, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package gettext.aarch64 0:0.19.8.1-3.el7 will be installed