Linux安装yum

安装yum

Yum是Linux系统中的软件包管理器,可以通过它来安装、更新和卸载软件包。下面是安装yum的步骤:

  1. 打开终端并以root用户身份登录。

  2. 检查系统是否已经安装了yum:

 yum --version

如果系统已经安装了yum,则会显示版本号,否则将会提示命令未找到。

  1. 安装yum:
 yum install yum-utils

或者

sudo apt-get install yum

这个命令会安装yum和其它相关工具。

  1. 配置yum:

    编辑yum的配置文件/etc/yum.conf,可以使用vi或nano等编辑器来进行编辑。

    vi /etc/yum.conf
    

    在文件中添加如下内容:

    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    installonly_limit=5
    bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
    distroverpkg=centos-release
    

    保存并退出配置文件。

  2. 更新yum缓存:

    yum makecache
    

    这个命令会从yum源更新软件包缓存。

现在yum已经成功安装并配置好了,你可以使用yum来安装、更新和卸载软件包了。

另外的问题

更改镜像源

cd /etc/apt/                            // 切换到/etc/apt/ 目录下
sudo cp sources.list sources.list.old   // 先把源文件复制到sources.list.old,备份
sudo vim sources.list                        //编辑文件

本文修改的sources.list文件内容如下:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

更新

sudo apt-get update
sudo apt-get install yum

其他问题可查看:https://blog.youkuaiyun.com/hanxiaoyong_/article/details/124771041

yum配置

资源配置

cd /etc/yum/repos.d/
sudo wget http://mirrors.163.com/.help/fedora-163.repo
sudo wget http://mirrors.163.com/.help/fedora-updates-163.repo

然后将上面两个文件里面的$releasever全部替换成17
然后生存元数据缓存,步骤如下:

sudo yum makecache
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

逍遥Sean

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值