2020年底的大爆炸消息就是CentOS官方宣布日后将专注于CentOS Stream,更是将CentOS 8的EOL(支援日期)从原先的2029年直接砍到2021年底(CentOS 7则是2024年6月30日)🙀 也就是说目前的发行顺序
Fedora -> Redhat -> CentOS
之后将会变成
Fedora -> CentOS Stream -> Redhat
从上游变下游,活生生变成小白鼠一族 😱🥶😱
CentOS Project shifts focus to CentOS Stream – Blog.CentOS.org
https://blog.centos.org/2020/12/future-is-centos-stream/
身为使用RHEL家族的老用户自然觉得会不爽,变成小白鼠就算了,别家系统是一个大版本撑5年,CentOS一个大版本撑10年,结果现在一刀挥下砍到支援时间都只剩一年 👺 但不爽也没办法,虽然有原CentOS创始人Gregory Kurtzer立刻开辟的新项目:Rocky Linux,但暂时还没有任何可测试的资源的情况下,只能先寻求其他的解决方案 👹
这段时间我在Oracle Cloud Free Tier试用了一下Oracle Linux 8,其优点是该系统一直是免费、也是RHEL家族、有官方支援、并且非常臭屁的说其系统还有UEK (Unbreakable Enterprise Kernel) 号称坚若磐石的内核可选,看在宣布与RHEL相容的关系下,再加上有0800的客服支援,个人觉得还是可以尝试看看的,个人一些心得放到部落格作个笔记 🏄♂️⛷🏄♀️
ref.
- Oracle Linux 官网下载点
- Oracle Linux VM templates 官网下载点
- zh-tw/FAQ/CentOSStream – CentOS Wiki
- Rocky Linux @ Github
- 红帽弃守CentOS Linux,将于明年底终止对CentOS Linux 8的支援 | iThome
- 红帽将重点从CentOS转移到Stream 维基新闻专访CentOS团队 – 维基新闻
- Linux中国 | 红帽关于 CentOS Stream 的官方解答
- Linux中国 | CentOS 8 落幕,“免费”的 RHEL 没了
- Oracle 建议 CentOS 使用者投奔 Oracle Linux,并提供了辅助工具 – OSCHINA – 中文开源技术交流社区
- How to Install Oracle Linux 8 in Virtual Box – Linux Hint
初始化环境设定
# 修改主机名称 🤓
1 2 |
hostnamectl set-hostname oracle-tyo01.520.be && hostname oracle-tyo01.520.be exec bash |
# 设定DNS 🤓
1 2 3 4 5 6 7 |
cat <<"EOF" > /etc/reslov.conf nameserver 1.1.1.1 nameserver 9.9.9.9 nameserver 2001:2001:: nameserver 2620:fe::fe EOF # cat /etc/reslov.conf |
# 启用EPEL Repo并且安装常用软体、更新系统 🤓
1 2 3 4 5 6 7 |
dnf install -y dnf-plugins-core redhat-lsb-core sudo sudo dnf install -y oracle-epel-release-el8 oraclelinux-developer-release-el8 sudo dnf config-manager --set-enabled ol8_developer_EPEL ol8_developer_UEKR6 sudo dnf makecache sudo dnf install -y make gcc screen perl tar unzip gzip bzip2 xz ftp mtr traceroute wget curl mutt crontabs htop mlocate net-tools bind-utils lsof ncdu sudo dnf update -y # dnf repolist |
# mutt邮件设定 🤓
1 2 3 4 5 6 7 8 9 |
cat <<"EOF" > ~/.muttrc set from="root@localhsot" set charset="utf-8" set send_charset="utf-8" set attach_charset="utf-8" EOF clear sed -i "s/^set from=.*$/set from='root@`cat /etc/hostname`'/g" ~/.muttrc # cat ~/.muttrc | grep from |
# 修改hosts for IPv6,没有IPv6的改用下一个 🤓
1 2 3 4 5 6 7 8 9 |
rm -f /etc/hosts.bak mv -f /etc/hosts /etc/hosts.bak sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 `/usr/bin/curl -4 icanhazip.com` `cat /etc/hostname` `/usr/bin/curl -6 icanhazip.com` `cat /etc/hostname`' > /etc/hosts" clear cat /etc/hosts # vi /etc/hosts |
# 修改hosts for IPv4 🤓
1 2 3 4 |
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 `/usr/bin/curl -4 icanhazip.com` `cat /etc/hostname`' > /etc/hosts" clear cat /etc/hosts |
以上就是大概的初始环境设定,其实大多常见的网站环境相关如httpd(2.4.37)、nginx(1.14.1)、php(7.2)、mysql(8.0)、mariadb(10.3)、git(2.27)等等的软体都有提供 🤓
dnf list httpd-\*
dnf list nginx-\*
dnf list php-\*
dnf list mysql-\*
dnf list mariadb-\*
另外有兴趣的也可以安装UEK的内核 🤓
sudo dnf install -y kernel-uek
systemctl reboot
uname -r
ref.
- What’s New – Oracle Linux Yum Server | Oracle
- Frequently Asked Questions about the Oracle Linux Yum Server | Oracle
- Oracle Linux 8 (x86_64) EPEL | Oracle
CentOS 7/8转换成Oracle Linux
Oracle也真的是老贼老贼的,不找不知道,他们居然有推出一支无痛转换的小程式:centos2ol,这个就是比较推荐的作法了,假设2021年底还没有什么好消息,我应该是会转投Oracle Linux或Debain的怀抱。而centos2ol用法也很简单 🤓🤖🤓
1 2 3 |
wget https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh chmod +x centos2ol.sh sudo bash centos2ol.sh |
重开机之后再进行一次更新系统 🤓
systemctl reboot
dnf update -y
cat oracle-release
ref.
- Oracle Linux: A better alternative to CentOS
- centos2ol @ github
- Switching from CentOS to Oracle Linux: a hands-on example | Oracle Blog
CentOS 8升级CentOS Stream
我相信其实很多人觉得其实还好,反正Linux系统本来就很难操坏,而且装了主机控制台之后就很少动到系统了,就算变成小白鼠又如何,备份做好比较实在。这我真的同意,因为我也会很懒得动,但真的比较不建议这样做,当小白鼠真的很麻烦,除非大多的软体都是用编译的才稍稍有可能会幸运些不会碰到怪手,所以如果没有使用主机控制台的使用者,当然是可以就认命点,干脆直接更新成CentOS Stream(使用cPanel、DirectAdmin、Plesk等等的主机控制台的使用者都还得等等,目前还不支援) 🤷♂️🤷♀️🤷♂️
1 2 3 |
dnf install -y centos-release-stream dnf swap -y centos-{linux,stream}-repos dnf distro-sync -y |
重开机之后再进行一次更新系统 🤓
systemctl reboot
dnf update -y
cat /etc/centos-release
ref.
- CentOS Stream
- How To Migrate To CentOS Stream From CentOS Linux 8 – OSTechNix
- CentOS 8 to CentOS Stream — Options | Liquid Web
