运维装机必备

1、需要关闭项

1.防火墙 firewalld
systemctl stop firewalld
systemctl disable firewalld

  • 2.selinux
  • 临时关闭
  • setenforce=0
  • 永久关闭
  • vim  /etc/selinux/config
  • 修改 SELINUX=disabled
  • 2、SSH远程连接慢的解决方法

  • 关闭dns
  • vim  /etc/ssh/sshd_config
  • 查找到UesDNS: /DNS  设置为no
    • UesDNS      no

重启服务
systemctl restart sshd

3、CentOS7替换阿里云源

3.1替换源

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

3.1.1docker容器内删除无效地址(下载问题)

 - 问题:
=> => # bz2: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyunc
 => => # s.com; Unknown error"
 - 解决:
    sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

 - 方法2
    替换base镜像
    sed -i "s/mirror.centos.org/mirrors.aliyun.com/g" /etc/yum.repos.d/CentOS-Base.repo
    -e 执行多个命令,1=删除 mirrorlist 2=开启 baseurl
    sed -i -e "/mirrorlist.centos.org/d" -e "s/#baseurl/baseurl/g" /etc/yum.repos.d/CentOS-Base.repo

centos 8
  替换base源
  curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
  替换AppStream源
  sed -i "s/mirror.centos.org/mirrors.aliyun.com/g" CentOS-Linux-AppStream.repo

3.2验证源

https://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml

3.3加速下载

国内源配合国内dns:114.114.114.114
国外源配合国外dns:1.1.1.1

4、本地源、三方源 nginx

4.1本地源

挂载cd:mount /dev/sr0 /mnt
本地位置:ls /etc/yum.repos.d/

4.2三方源

curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
yum install epel-release -y
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

4.3配置本地优先

1.yum install yum-plugin-fastestmirror -y
2.yum install yum-plugin-priorities -y

priority=1  //值越小优先级越高
3.建立缓存
yum clean all
yum makecache

5、minimal安装

在进行Linux系统的 Minimal(最小化)安装时,许多非核心或非必要的软件包和文档通常不会被默认安装,以减少系统体积、提高安全性和加快安装速度。以下是一些常见的、在Minimal安装中通常不会默认安装的文档或类别:

5.1 图形界面与桌面环境:如GNOME、KDE、XFCE等桌面环境及其相关的图形界面应用程序和配置工具。

5.2 开发者工具和编译器:GCC(GNU Compiler Collection)、Make、CMake等编译工具,以及Python、Perl、Ruby等解释型语言的开发环境和库文件。

5.3 手册页(man pages):虽然一些基础命令的手册页可能包含在最小安装中,但完整的man-pages集合可能不会安装,尤其是与未安装软件包相关的文档。

5.4 系统管理工具:一些高级系统管理工具和图形界面管理工具,如Webmin、 Cockpit等可能不会预装。

5.5 办公套件和生产力软件:LibreOffice、Firefox、Thunderbird等办公和互联网浏览工具。

5.6 多媒体应用:音频播放器(如Rhythmbox)、视频播放器(如VLC)、图像编辑器(如GIMP)等。

5.7 游戏:所有的娱乐游戏软件都不会被安装。

5.8 额外的库文件和开发库:除非是系统运行所必需的,否则额外的库文件,特别是开发用的头文件和库文件(如lib*-devel包)不会被安装。

5.9 网络服务:如Apache HTTP服务器、MySQL数据库服务器、DNS服务器(BIND)等,除非选择安装作为服务器角色的一部分。

5.10 文档和示例:许多软件包自带的额外文档、教程、示例脚本和配置文件往往不会被安装。

5.11 国际化与本地化支持:完整的语言包、字体和输入法支持可能不会安装,除非在安装过程中特别选择。

进行Minimal安装后,如果需要上述任何组件,可以通过软件包管理器(如apt、yum或dnf)手动安装。

6、Tab增强

1.yum install epel-release -y
2.yum install bash-completion -y
3.yum install bash-completion-extras -y

查看bash_completion.sh
find / -name bash_completion.sh

[root@localhost ~]# find / -name bash_completion.sh
/etc/profile.d/bash_completion.sh

执行(生效):
source /etc/profile 或者. /etc/profile

使用tab键可补全命令,双击查看可以执行的命令。

7、时间

https://blog.csdn.net/2401_84415718/article/details/140132939?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22140132939%22%2C%22source%22%3A%222401_84415718%22%7D

8、开机等待时间

vim /boot/grub2/grub.cfg
设置1S:timeout=1

9、CentOS6、7需要安装的常用企业运维基础包

命令:yum install tree nmap dos2unix lrzsz nc lsof wget tcpdump htop iftop iotop sysstat nethogs psmisc net-tools bash-completion vim-enhanced -y
tree:以树状形式显示。
nmap:nmap扫描端口的工具。
dos2unix:转换脚本格式的工具。
lrzsz:包含上传(rz)下载(sz)文件工具。
nc:文件传输、端口检查。
lsof:反查端口进程,以及服务开发文件工具。
wget:下载软件包工具。
tcpdump:抓包、监听等重要排错工具。
htop:系统进程相关信息查看工具。
iftop:查看主机网卡带宽工具。
iotop:监控磁盘I/O情况。
sysstat:含有sar,iostat等重要系统性能查看工具。
nethogs:显示进程的网络流量。
psmisc:含有killall、pstree等命令。
net-tools:含有netstat、ifconfig、route、arp等命令。
bash-completion:tab补全功能工具包。
vim-enhanced:vim编辑器工具包。

10、No manual entry for syslog

解决方法:安装帮助手册:yum install man-pages -y
min安装没有默认安装。

拓展:
man-pages.noarch 是一个Linux系统中的软件包,它包含了大量manual pages(手册页)。Manual pages 是Linux和类UNIX系统中的一种在线文档形式,为系统命令、库函数、系统调用、文件格式和概念等提供了详细的参考信息。用户可以通过在终端输入 man 命令加上相应条目名称来查看这些文档,例如 man ls 会显示关于 ls 命令的手册页。
.noarch 的含义: 表示这个软件包不依赖于特定的处理器架构(如x86、x64等),可以在所有类型的Linux系统上安装和运行。

11、 PackageKit-command-not-found

解释:在Linux系统中帮助用户找到并安装缺少的命令或软件包的工具。

yum install PackageKit-command-not-found -y

  • 28
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值