ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Ubuntu软件管理工具

2022-08-22 22:00:32  阅读:170  来源: 互联网

标签:universe Ubuntu 管理工具 https ubuntu 软件 deb main com


dpkg 包管理器

  • 语法格式

    dpkg [option] [package]
    
  • 常见用法

    #安装包,不支持包的依赖
    dpkg -i package.deb
    #删除包,不建议,不自动卸载依赖于它的包
    dpkg -r package
    #删除包(包括配置文件)
    dpkg -P package
    #列出当前已安装的包,类似rpm -qa
    dpkg -l
    #显示该包的简要说明
    dpkg -l package
    #列出该包的状态,包括详细信息,类似rpm –qi
    dpkg -s package
    #列出该包中所包含的文件,类似rpm –ql
    dpkg -L package
    #搜索包含pattern的包,类似rpm –qf
    dpkg -S <pattern>
    #配置包,-a 使用,配置所有没有配置的软件包
    dpkg --configure package
    #列出 deb 包的内容,类似rpm –qpl
    dpkg -c package.deb
    #解开 deb 包的内容
    dpkg --unpack package.deb
    
  • 范例

    #列出系统上安装的所有软件包
    dpkg -l
    #列出软件包安装的文件
    dpkg -L bash
    #查看/bin/bash来自于哪个软件包
    dpkg -S /bin/bash
    #安装本地的 .deb 文件
    dpkg -i /mnt/cdrom/pool/main/z/zip/zip_3.0-11build1_amd64.deb
    #卸载软件包
    dpkg -r zip
    
  • 注意:

    一般建议不要使用dpkg卸载软件包。因为删除包时,其它依赖它的包不会卸载,并且可能无法再正常运行

apt工具集来管理包系统

  • apt与apt-get命令对比

    apt 命令 被取代的命令 命令的功能
    apt install apt-get install 安装软件包
    apt remove apt-get remove 移除软件包
    apt purge apt-get purge 移除软件包及配置文件
    apt update apt-get update 刷新存储库索引
    apt upgrade apt-get upgrade 升级所有可升级的软件包
    apt autoremove apt-get autoremove 升级所有可升级的软件包
    apt full-upgrade apt-get dist-upgrade 在升级软件包时自动处理依赖关系
    apt search apt-get search 在升级软件包时自动处理依赖关系
    apt show apt-cache show 搜索应用程序
  • apt 特有的命令

    apt list 列出包含条件的包(已安装,可升级等)
    apt edit-sources 编辑源列表
    
  • apt包索引配置文件

    /etc/apt/sources.list
    /etc/apt/sources.list.d
    
  • 常用国内镜像源版本

    #本节均为 Ubuntu 20.04 的镜像源列表。若为其他版本,将所有focal更改为其他版本代号即可。
    常用的Ubuntu版本代号如下:
    Ubuntu 22.04:jammy
    Ubuntu 20.04:focal
    Ubuntu 18.04:bionic
    Ubuntu 16.04:xenial
    
  • 配置apt包索引文件

    • 阿里云源:ubuntu 16.04 配置如下

      deb https://mirrors.aliyun.com/ubuntu/ xenial main
      deb-src https://mirrors.aliyun.com/ubuntu/ xenial main
      
      deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
      deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main
      
      deb https://mirrors.aliyun.com/ubuntu/ xenial universe
      deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
      deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
      deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
      
      deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
      deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
      deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
      deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe
      
    • 阿里云源:ubuntu 18.04(bionic) 配置如下

      deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
      deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
      
      deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
      deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
      
      deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
      deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
      
      # deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
      # deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
      
      deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
      deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
      
      
    • 阿里云源:ubuntu 20.04(focal) 配置如下

    deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    
    # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    
    • 清华源:Ubuntu20.04

      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
      
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
      
      ## Pre-released source, not recommended.
      # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
      
    • 网易163:Ubuntu20.04

    deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
    
    # deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
    
    ## Pre-released source, not recommended.
    # deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
    
    

标签:universe,Ubuntu,管理工具,https,ubuntu,软件,deb,main,com
来源: https://www.cnblogs.com/zxl1024320609/p/16614407.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有