
❀保持低旋律节奏->个人主页

本章命令是小时,着重需要理解的是下面总结的4个点
1.yum能够安装软件,yum安装软件是在云服务器上安装,云服务器上有人会提供免费的文件。
2.yum、apt 这两个都是linux系统的包管理器。它对应的是客户端------不同的linux系统,与客户端对应的就是服务器
3.yum、apt 下载的时候 一定有它所对应的配置资源、配置文件、配置文件里面就有相应的链接。
4.我们文件里的链接 默认是连接到国外的。 云服务器在国内,国内云服务器通过拷贝国外网站,形成了镜像网站。镜像解决了访问外网速度慢的问题
文章目录
查看发行版和版本号指令
cat /etc/os-release 查看linux系统发行版 和版本号指令
bash
[ljy@VM-0-12-centos ~]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
查看内核更详细的信息指令
uname -a
bash
[ljy@VM-0-12-centos ~]$ uname -a
Linux VM-0-12-centos 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
查看软件包信息指令
yum list | grep lrzsz 过滤以lrzsz命名的软件包
bash
#centOS
[ljy@VM-0-12-centos ~]$ yum list | grep lrzsz
Repository epel is listed more than once in the configuration
lrzsz.x86_64 0.12.20-36.el7 @os
#ubuntu
apt search lrzsz
apt show lrzsz
x86_64 代表体系结构x86 后缀表示64位系统安装包
el7 表示系统发行版版本位el7
base 表示软件源的名称 类似于手机中得以应用商店
软件包安装卸载命令
sudo\] yum install \[-y\] 软件包名称 \[sudo\] yum remove \[-y\] 软件包名称 普通用户安装命令需要进行提权 超级用户不需要进行提权
bash
#yum
[ljy@VM-0-12-centos ~]$ sudo yum install -y tree
[ljy@VM-0-12-centos ~]$ sudo yum remove -y tree
#apt
sudo apt install -y tree
sudo apt remove -y tree
- 这里注意安装卸载只能进行一个,当你在安装一个软件包的时候,不能删除/安装另外一个软件包 否则就会报错
查看软件"仓库"里面的配置文件命令
ls /etc/yum.repos.d
bash
#cenOS
[ljy@VM-0-12-centos ~]$ ls /etc/yum.repos.d
CentOS-Base.repo CentOS-Epel.repo epel.repo epel-testing.repo
[ljy@VM-0-12-centos ~]$ ll /etc/yum.repos.d/
total 16
-rw-r--r-- 1 root root 641 Dec 1 20:32 CentOS-Base.repo //标准源
-rw-r--r-- 1 root root 230 Dec 1 20:32 CentOS-Epel.repo //拓展源
-rw-r--r-- 1 root root 1358 Sep 5 2021 epel.repo
-rw-r--r-- 1 root root 1457 Sep 5 2021 epel-testing.repo
#ubuntu
ls /etc/apt/sources.list.d
cat /etc/apt/sources.list # 标准源
ll /etc/apt/sources.list.d/ # 扩展源