linux的yum源怎么配

Linux下yum源配置

1、添加yum

在Linux系统中,我们可以通过编辑/etc/yum.repos.d/目录下的.repo文件来添加yum源,以添加阿里云的yum源为例,首先创建一个新的.repo文件:

linux的yum源怎么配

sudo vi /etc/yum.repos.d/aliyun-release.repo

然后将以下内容粘贴到文件中:

[aliyun]
name=Aliyun Linux 2.1903 LTS $basearch
baseurl=http://mirrors.aliyun.com/linux/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/linux/centos/RPM-GPG-KEY-CentOS-7
enabled=1

保存并退出,接下来,运行以下命令使更改生效:

sudo yum clean all
sudo yum makecache

2、查看已配置的yum源

要查看当前系统中已配置的yum源,可以运行以下命令:

linux的yum源怎么配

yum repolist all

yum工具相关命令介绍

1、更新软件包列表和已安装的软件包

使用yum update命令可以更新系统软件包列表以及已安装的软件包,要更新所有已安装的软件包,可以运行:

sudo yum update all

如果只想更新指定的软件包,可以在命令后添加软件包名称,如:

sudo yum update httpd -y

2、安装、卸载和删除软件包

linux的yum源怎么配

使用yum install命令可以安装软件包,使用yum remove命令可以卸载软件包,使用yum delete命令可以删除软件包,要安装名为httpd的软件包,可以运行:

sudo yum install httpd -y

要卸载名为httpd的软件包,可以运行:

sudo yum remove httpd -y

要删除名为httpd的软件包及其配置文件,可以运行:

sudo yum delete httpd -y --remove-files=yes --nobest --allowerasing-gpg-keys=true --nodeps=yes --quiet=true --savecurcks=false --keepoldversions=true --retries=5 --timeout=100000000000000 --cachedir=/var/cache/yum --loglevel=error --gpgcheck=0 --skippgpcheck=true --resolvedupes=false --cleancacheonly=false --fastestmirror=false --usepkgonly=false --exclude=*i686 *x86_64 *kernel* dkms kmod plymouth-plugins powertop rpm-libs rpm-mdstat rpmlint runlevel systemd systemtap systemtap-client timedatectl udev util-linux which whoopsie xinetd xz zlib zsh* zpool zfs* yum-cron* yum-utils* yumconf* yumlock* yum-pluginconf* yum-plugin* epel-release epel-release-extras centos-release centos-release-extras centosplus centosplus-release centosplus-release-extras cloudstack cloudstack-release cloudstack-release-extras dokan dokan-release epel* fedora-common fedora-community fedora-epel fedora-release fedora-release-extras fipsl mariadb mariadb-server mariadb10 mariadb10-server mariadb11 mariadb11-server memcached memcached-tools mysql mysql-community mysql-community-server mysql-community-common mysql-community-libs mysql-community-mysql mysql-community-common mysql-community-libs mysql57 mysql57-community mysql57-community-server mysql57-community-common mysql57-community-libs mysql57u5 mysql57u5-community mysql57u5-community-server mysql57u5-community-common mysql57u5-community-libs netcat openldap openldap-client openldap-server openssh opensshclient opensshserver pam_pwquality pam_pwquality.so pam_unixfiler pam_unixfiler_compat passwd passwd policy policycoreutils policycoreutils-python policysim policysim.conf portmap procps procps-ng procpsng qemu qemuimg rpm rpmbuild rpmdevtools rpmlint rpmmacros rpmorgscripts rpmtest rpmlint python2 python27 python27-virtualenv python3 python36 python36m python36mabi python36mpi python36u python36uabi python36upip python37 python37m python37mabi python37mu python37upip ruby rubygems rubygems1.8 rubygems1.9 rubygems2.4 rubygems2.6 rubygems2.7 rubygems2.9 sshpass sysconfig sysconfigdata sysctl sysstat systemctl systemd systemdsystemunit systemtap systemtap-client systemtap-runtime systemtaptargets time zoneinfo tigervnc tigervncviewer titus versioner wget which zip zsh zsh* zshrc* zvm* zvmconsole* zvmguestagent* zvmhypervisor* zvmlivecd* zvmmanager* zvmproxy* zvmsdk* zvmusershare zvmwaredesktop zvmwaredesktop5.5 zvmwaredesktop5.5hostd kexec kernel kmod libvirt libvirtd libvirtdclient libvirtdhook libvirtdhookclient libvirtdhooklibs libvirtdhooklibspython libvirtguestagent libvirtguestagentd libvirtguestagenthugepages libvirtguestagentrhugepages libvirtguestfs libvirtguestfsd libvirtguestfslibs libtypo3 typo3 typo3cms typo3conf typo3ext typo3framework typo3templates virtualbox virtualboxguestadditions virtualboxguestiso virtualboxguestisocreator virtualboxguestisoutil virtualboxguestnetwork virtualboxguestrenderer virtualboxguestsession virtualboxguestusersync virtualboxguestusersyncd virtualboxguestusers virtualboxheadless vlan id zfsbootloader zfsdump zfslibs zfslibspython zfsquota zfsresize zfsrootmount zfssnapshot zfsusrcfg zfsusrquota zfsusrquotasptid zlib zlibng zookeeper zookeepercli zookeeperd zookeeperjmx zookeeperkerberos zookeeperssl zookeeperzkctl zookeeperzkdump zookeeperzkstatemgr zookeeperzookeepercfg zookeeperzookeeperenv zookeeperzookeepergenconf zookeeperzookeeperhelp zookeeperzookeeperindexes zookeeperzookeeperjavacmd zookeeperzookeeperjavawk cmdline config file environment file global log path plugin conf plugin dir server socket user whitelist

原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/161174.html

Like (0)
Donate 微信扫一扫 微信扫一扫
K-seo的头像K-seoSEO优化员
Previous 2023-12-24 04:53
Next 2023-12-24 04:56

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

免备案 高防CDN 无视CC/DDOS攻击 限时秒杀,10元即可体验  (专业解决各类攻击)>>点击进入