######################################################################################

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

epel源

yum install epel-release

docker 源

yum install yum-utils

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

阿里云docker-ce 镜像

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

docker-compose安装

curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

mysql yum源

下载 wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

安装此rpm包

rpm -ivh mysql57-community-release-el7-9.noarch.rpm

安装完后会在/etc/yum.repos.d/下生成mysql的yum源文件,mysql-community.repo mysql-community-source.repo

 

 

######################################################################################

其他yum源 

1. 企业贡献:
搜狐开源镜像站:http://mirrors.sohu.com/
网易开源镜像站:http://mirrors.163.com/

2. 大学教学:
北京理工大学:
http://mirror.bit.edu.cn (IPv4 only)
http://mirror.bit6.edu.cn (IPv6 only)
北京交通大学:
http://mirror.bjtu.edu.cn (IPv4 only)
http://mirror6.bjtu.edu.cn (IPv6 only)
http://debian.bjtu.edu.cn (IPv4+IPv6)
兰州大学:http://mirror.lzu.edu.cn/
厦门大学:http://mirrors.xmu.edu.cn/
清华大学:
http://mirrors.tuna.tsinghua.edu.cn/ (IPv4+IPv6)
http://mirrors.6.tuna.tsinghua.edu.cn/ (IPv6 only)
http://mirrors.4.tuna.tsinghua.edu.cn/ (IPv4 only)
天津大学:http://mirror.tju.edu.cn/
中国科学技术大学:
http://mirrors.ustc.edu.cn/ (IPv4+IPv6)
http://mirrors4.ustc.edu.cn/
http://mirrors6.ustc.edu.cn/
东北大学:
http://mirror.neu.edu.cn/ (IPv4 only)
http://mirror.neu6.edu.cn/ (IPv6 only)
电子科技大学:http://ubuntu.uestc.edu.cn/

######################################################################################

 

常用命令:

1,查询某个软件包的不同版本

yum list --showduplicates | grep ****

2,清楚yum 缓存

yum clean all

遇到长时间没有跟新导致缓存太旧的情况,可以先clean 再 makecache

3,缓存包信息,使查询提速

yum makecache fast

4,使用缓存查询软件包让速度提升

yum -C search vsftpd

可以自己尝试去掉-C 之后的速度差距

5,列出已安装的软件包

yum list installed

6,修改主机名

  hostname newhostname

  hostnamectl set-hostname newhostname

7,ab 性能测试工具安装

yum -y install httpd-tools

8, ifconfig 命令安装

yum install -y net-tools

9, 新机器初始化安装一下软件可以解决99%的依赖问题:

yum -y install gcc gcc-c++ make autoconf libtool-ltdl-devel gd-devel freetype-devel libxml2-devel libjpeg-devel libpng-devel openssh-clients openssl-devel curl-devel bison patch libmcrypt-devel libmhash-devel ncurses-devel binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel libgcj libtiff pam-devel libicu libicu-devel gettext-devel libaio-devel libaio libgcc libstdc++ libstdc++-devel unixODBC unixODBC-devel numactl-devel glibc-headers sudo bzip2 mlocate flex lrzsz sysstat lsof setuptool system-config-network-tui system-config-firewall-tui ntsysv ntp pv lz4 dos2unix unix2dos rsync dstat iotop innotop mytop telnet iftop expect cmake nc gnuplot screen xorg-x11-utils xorg-x11-xinit rdate bc expat-devel compat-expat1 tcpdump sysstat man nmap curl lrzsz elinks finger bind-utils traceroute mtr ntpdate zip unzip vim wget net-tools

10,关闭Selinux、iptables、swap分区    

systemctl stop firewalld
systemctl disable firewalld
iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat
iptables -P FORWARD ACCEPT
swapoff -a
sed -i '/ swap / s/^(.*)$/#1/g' /etc/fstab
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

 

posted on 2020-12-04 21:37  EZgod  阅读(612)  评论(0编辑  收藏  举报