编译安装LINUX

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm --import https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS
==================
curl -O https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
tar -zxvf Python-3.9.0.tgz
cd Python-3.9.0 && ./configure prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
python3 --version
pip3 --version
===================================
"当前资源包支持的操作系统有:
[{'distribution': 'Ubuntu', 'versions': ['20.04']},
{'distribution': 'Anolis', 'versions': ['8.5', '8.4']},
{'distribution': 'CentOS', 'versions': ['7.6', '7.8', '7.9', '8']},
{'distribution': 'RedHat', 'versions': ['7.9', '8.5']},
{'distribution': 'OracleLinux', 'versions': ['8.5']},
{'distribution': 'Rocky', 'versions': ['8.5']},
{'distribution': 'openEuler', 'versions': ['20.03', '22.03']},
{'distribution': 'Kylin Linux Advanced Server', 'versions': ['V10']},
{'distribution': 'openSUSE Leap', 'versions': ['15.3']}]"
]
=================
导入公钥
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS
===================
yum -y install wget
yum -y install setup
yum -y install perl
wget https://gitee.com/anolis/centos2anolis/raw/master/centos2anolis.py
yum -y install python3
python3 centos2anolis.py
================
wget https://gitee.com/anolis/leapp/repository/archive/master.zip
unzip master.zip
cd leapp-master
# 通过脚本部署leapp
sh leapp-install.sh
sh leapp-repository-install.sh
====8.4==================
https://mirrors.openanolis.cn/anolis/8.4/isos/GA/x86_64/AnolisOS-8.4-x86_64-dvd.iso
https://mirrors.openanolis.cn/anolis/8.4/isos/GA/AnolisOS-8.4-x86_64-dvd.iso.md5sum
======Anolis升级或者降低版本到8.5=================
cat /etc/anolis-release
cat /etc/os-release
#升级操作,一般不进行
sudo yum clean all && sudo yum -y update
#查看当前more /etc/yum.repos.d/CentOS-Vault.repo
cd /etc/yum.repos.d/
more /etc/yum.repos.d/AnolisOS-Source.repo
#AnolisOS-Debuginfo.repo AnolisOS-extras.repo AnolisOS-os.repo AnolisOS-Plus.repo AnolisOS-Source.repo AnolisOS-updates.repo docker-ce.repo
#Debuginfo extras os Plus Source updates
=================打开 Plus 仓库并同时安装稳定版 ANCK-4.19 内核8.5内核更新==========
ip address
sudo yum install kernel --enablerepo=Experimental
#打开 Experimental 仓库并同时安装试验性质的 ANCK-5.10 内核(仅在 Anolis OS 8.4 及更高版本上支持):
sudo yum install kernel --enablerepo=Experimental
===============正式开始========
cat /etc/redhat-release
yum -y install epel-release
yum -y install yum-utils
yum -y install rpmconf
rpmconf -a
package-cleanup --leaves
package-cleanup --orphans
yum -y install dnf
dnf -y remove yum yum-metadata-parser
rm -rf /etc/yum
dnf upgrade

dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}

dnf upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf clean all
rpm -e `rpm -q kernel
=========================
部署Nginx:

登录后复制
# dnf -y install nginx
# systemctl start nginx
# systemctl status nginx
# ss -tunlp | grep 80
# systemctl enable nginx
====================
基于KVM技术的虚拟化环境
Alibaba Cloud Linux 2等保2.0三级版镜像

yum-config-manager --add-repo https://mirrors.openanolis.org/inclavare-containers/alinux2-repo && \
rpm --import https://mirrors.openanolis.org/inclavare-containers/alinux2-repo/RPM-GPG-KEY-rpm-sign && \
yum install -y rune


创建ECS实例时,实例规格选择安全增强型ecs.g7t、公共镜像选择Alibaba Cloud Linux 3.2104 64位 UEFI版
Alibaba Cloud Linux 2.1903 LTS 64位 UEFI版
================
npm install element-plus --save
==========硬件准备===========
1核2G
不少于 10G 磁盘空余空间
安装centos7.9以下版本
配置内网互通和IP地址
=============
#查询安装过的包
yum list installed | grep docker

yum remove docker-ce
#删除docker资源存放的相关文件
rm -rf /var/lib/docker
#docker ps -a 查看容器
#移除所有
docker kill $(docker ps -q) ; docker rm $(docker ps -a -q) ; docker rmi $(docker images -q -a)
=========================
docker rm $(docker ps -a -q) #正在运行的删除不了,所有未运行的都被删除了
yum remove docker \
docker-ce\
docker-ce-cli\
docker-ce-rootless-extras\
docker-scan-plugin\
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
===============
杀死所有正在运行的容器

docker kill $(docker ps -a -q)
删除所有已经停止的容器

docker rm $(docker ps -a -q)
删除所有未打 dangling 标签的镜像

docker rmi $(docker images -q -f dangling=true)
通过镜像的id来删除指定镜像

docker rmi <image id>
删除所有镜像

docker rmi $(docker images -q)
================系统安装好 docker=======
yum -y install yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker
docker version
(客户端到此结束)
============sp安装=======================
docker run -d \
--privileged \
--restart=unless-stopped \
--name=kuboard-spray \
-p 80:80/tcp \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/kuboard-spray-data:/data \
eipwork/kuboard-spray:latest-amd64
=======关闭===UseDNS============
#编辑 /etc/ssh/sshd_config
vi /etc/ssh/sshd_config
#添加或修改
UseDNS no
#重启 sshd 服务
systemctl restart sshd
========升级到centos7.9==CentOS升级到指定小版本====
#备份原来源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
cat /etc/redhat-release
yum clean all
yum update
init 6
==========升级======
yum clean all #清除 Yum 在本机的缓存
yum repolist #查看仓库信息
yum update #更新,系统会自动更新你源配置的版本
==================
参考
https://blog.csdn.net/SmithYan/article/details/104779272
https://www.csdn.net/tags/MtTaMg0sMzc1NjktYmxvZwO0O0OO0O0O.html
https://blog.csdn.net/qq_34208660/article/details/120216328
=====================
一,修改yum源

[root@bogon yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=
baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=
baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=
#baseurl=
gpgcheck=1
enabled=0
gpgkey=


二。执行命令将7.5更新为7.6,完成后重启即可

yum update -y
======================
操作记录如下:

[root@jwbdb alpha]# chkconfig –list yum-updatesd

yum-updatesd    0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

[root@jwbdb alpha]# service yum-updatesd stop

停止 yum-updatesd:                                        [确定]

[root@jwbdb alpha]# service yum-updatesd status

yum-updatesd 已停

[root@jwbdb alpha]# chkconfig –level 35 yum-updatesd off

[root@jwbdb alpha]# chkconfig –list yum-updatesd

yum-updatesd    0:关闭  1:关闭  2:启用  3:关闭  4:启用  5:关闭  6:关闭
-----------------------------------

 

http://olcentchan.chinacloudapp.cn/centos/7.8.2003/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

========================

# vim /etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-7.6.1810 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.6.1810/os/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/os/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/os/$basearch/
gpgcheck=1
gpgkey=http://olcentchan.chinacloudapp.cn/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-7.6.1810 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.6.1810/updates/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/updates/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/updates/$basearch/
gpgcheck=1
gpgkey=http://olcentchan.chinacloudapp.cn/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-7.6.1810 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.6.1810/extras/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/extras/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/extras/$basearch/
gpgcheck=1
gpgkey=http://olcentchan.chinacloudapp.cn/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7.6.1810 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.6.1810/centosplus/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/centosplus/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://olcentchan.chinacloudapp.cn/centos/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-7.6.1810 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.6.1810/contrib/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/contrib/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.6.1810/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://olcentchan.chinacloudapp.cn/centos/RPM-GPG-KEY-CentOS-7

 

===更换yum==========================
# 对于 CentOS 7
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo

# 对于 CentOS 8
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
=============================================
更换yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
更换epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
————————————————
#更新缓存
sudo yum makecache
yum clean all
#重启
init 6
更新源
#yum update
#升级
yum upgrade
===========
# 此条不用 yum --disablerepo='*' --enablerepo='C7.5*' upgrade
#检查内核版本
yum info kernel -q
#查看现在可用仓库列表
yum repolist
# 查看现在可用仓库版本
yum list updates | grep "centos-release"
#清空本地缓存
yum clean all
rm -rf /var/cache/yum
# 版本升级
yum -y update
# 查看更新后的版本
cat /etc/redhat-release
备份过渡的repo仓库文件,启用新版的仓库文件
# mv /etc/yum.repos.d/CentOS-Vault.repo /etc/yum.repos.d/backup/
# mv /etc/yum.repos.d/CentOS-Vault.repo.rpmnew /etc/yum.repos.d/CentOS-Vault.repo
清空本地缓存,更新版本库文件
# yum clean all
# yum makecache

====删除kubeadm==============
#在卸载K8s组件前,先执行kubeadm reset命令,清空K8s集群设置
kubeadm reset
#把之前通过yum安装的管理组件卸载
yum erase -y kubelet kubectl kubeadm kubernetes-cni
#基础组件通过Docker镜像部署,因此只需要强制删除对应镜像即可卸载
docker kill $(docker ps -q) ; docker rm $(docker ps -a -q) ; docker rmi $(docker images -q -a)
=====批量删除================
kubeadm reset
yum erase -y kubelet kubectl kubeadm kubernetes-cni
docker kill $(docker ps -q) ; docker rm $(docker ps -a -q) ; docker rmi $(docker images -q -a)
yum remove docker \
docker-ce\
docker-ce-cli\
docker-ce-rootless-extras\
docker-scan-plugin\
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
=======================
https://help.aliyun.com/document_detail/370863.htm?spm=a2c4g.11186623.0.0.3b001f02OoDOQE#task-2155335
wget http://mirrors.aliyun.com/alinux/migration/alinux-migration.repo -O /etc/yum.repos.d/alinux-migration.repo
yum -y install centos7toalinux2
centos7toalinux2.py
cat /etc/os-release
reboot

posted @ 2022-05-17 18:35  飞雪飘鸿  阅读(112)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL