1、linux系统安装命令梳理 yum rpm pip apt-get wget

本文详细介绍了Linux系统中常用的包管理工具,包括yum、rpm、apt-get及pip的使用方法,对比了Redhat与Debian系列系统的包管理差异,并解释了包依赖关系的处理。

刚开始使用linux系统的时候,由于需要会安装各种各样的包,也用过centos7和ubuntu两个不同系统,装东西的时候没有习惯用哪种方式,博客用的什么就用什么。现在想简单梳理一下这几种安装命令。

yum
全称是“Yellow dog Updater,Modified”
是redhat、centos、Fedora系统(都是基于linux的系统)下的安装方式
能够指定的服务器自动下载RPM包并安装(也可设置只下载包但不安装),可以自动处理依赖关系,安装所有依赖的软件包。
rpm
全称是“redhat package management”
redhat系统下的软件管理包
用来安装、卸载xx.rpm软件
apt-get
是ubuntu下的一种安装方式,基于debain
pip
全称是“A tool for installing and managing Python packages”
是python的包安装工具
wget
不是一种安装方式,是一种下载工具,类似迅雷
用法:wget xxxxx(下载地址)
例如:wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
相关知识
1、Linux系统基本有两大类:

  (1)Redhat系列:Redhat、 Fentos、 Fedora等。

         常见的安装包格式是rpm包,安装rpm包的命令是“rpm -ivch xxx.rpm”
         包管理工具是yum (常用命令yum install xxx 、 yum remove xxx、  yum update xxx)
         支持tar包
  (2)Debian系列:Debian、 Ubuntu等。

         常见的安装包格式是deb包,安装rpm包的命令是“dkkg -参数”
         包管理工具是apt-get  (常用命令apt-get install xxx 、 apt-get remove xxx、  apt-get update xxx)
         支持tar包
2、linux系统里文件没有扩展名

举例
使用wget下载一个 rpm包, 然后用 rpm -ivh  xxx.rpm  安装这个包,系统可能会提示在安装此包之前,必须先安装另一个包,只有将那个包安装好,才能继续安装你要安装的包,这种就是包之间的依赖关系。

如果安装一个包,还要依赖好多包,那rpm就不太好用了,这种情况下,通常使用yum命令。  yum  install  xxx(包名),能自动下载和安装依赖包。
--------------------- 
作者:Insomnia620 
来源:优快云 
原文:https://blog.youkuaiyun.com/qq_38214193/article/details/82014063 
版权声明:本文为博主原创文章,转载请附上博文链接!

# Use the official Ubuntu base image FROM swr.cn-central-221.ovaijisuan.com/mindformers/mindformers1.2_mindspore2.3:20240722 USER root # Set environment variables to non-interactive to avoid prompts during installation ENV DEBIAN_FRONTEND=noninteractive # Update the package list and install necessary packages RUN apt-get update && \ apt-get install -y \ software-properties-common && \ add-apt-repository -y ppa:deadsnakes/ppa && \ apt-get update && \ apt-get install -y \ python3.10 \ python3.10-venv \ python3.10-distutils \ python3.10-dev \ python3-pip \ wget \ git \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Set Python 3.10 as the default python3 RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 # Create a virtual environment for MinerU RUN python3 -m venv /opt/mineru_venv # Copy the configuration file template and install magic-pdf latest RUN /bin/bash -c "wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/magic-pdf.template.json && \ cp magic-pdf.template.json /root/magic-pdf.json && \ source /opt/mineru_venv/bin/activate && \ pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple && \ pip3 install torch==2.3.1 torchvision==0.18.1 -i https://mirrors.aliyun.com/pypi/simple && \ pip3 install -U magic-pdf[full] 'numpy<2' decorator attrs absl-py cloudpickle ml-dtypes tornado einops -i https://mirrors.aliyun.com/pypi/simple && \ wget https://gitee.com/ascend/pytorch/releases/download/v6.0.rc2-pytorch2.3.1/torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl && \ pip3 install torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" # Download models and update the configuration file RUN /bin/bash -c "source /opt/mineru_venv/bin/activate && \ pip3 install modelscope -i https://mirrors.aliyun.com/pypi/simple && \ wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/scripts/download_models.py -O download_models.py && \ python3 download_models.py && \ sed -i 's|cpu|npu|g' /root/magic-pdf.json" # Set the entry point to activate the virtual environment and run the command line tool ENTRYPOINT ["/bin/bash", "-c", "source /opt/mineru_venv/bin/activate && exec \"$@\"", "--"] 基于ubuntu的dockerfile 怎么改成基于centos
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值