安装yum
Yum是Linux系统中的软件包管理器,可以通过它来安装、更新和卸载软件包。下面是安装yum的步骤:
-
打开终端并以root用户身份登录。
-
检查系统是否已经安装了yum:
yum --version
如果系统已经安装了yum,则会显示版本号,否则将会提示命令未找到。
- 安装yum:
yum install yum-utils
或者
sudo apt-get install yum
这个命令会安装yum和其它相关工具。
-
配置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
保存并退出配置文件。
-
更新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