Ubuntu软件管理工具

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

本文作者:天梯的脚印

本文链接:https://www.cnblogs.com/zxl1024320609/p/16614407.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   天梯的脚印  阅读(122)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 イエスタデイ(翻自 Official髭男dism) 茶泡饭,春茶,kobasolo
  2. 2 世间美好与你环环相扣 柏松
世间美好与你环环相扣 - 柏松
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.

作词 : 尹初七

作曲 : 柏松

编曲 : 彭圣杰

偏偏秉烛夜游

偏偏秉烛夜游

午夜星辰 似奔走之友

爱你每个结痂伤口

酿成的陈年烈酒

入喉尚算可口

入喉尚算可口

怎么泪水 还偶尔失守

邀你细看心中缺口

裂缝中留存 温柔

此时已莺飞草长 爱的人正在路上

此时已莺飞草长 爱的人正在路上

我知他风雨兼程 途经日暮不赏

穿越人海 只为与你相拥

此刻已皓月当空 爱的人手捧星光

我知他乘风破浪 去了黑暗一趟

感同身受 给你救赎热望

知道你不能 还要你感受

知道你不能 还要你感受

让星光加了一点彩虹

让樱花偷偷 吻你额头

让世间美好 与你环环相扣

此时已莺飞草长 爱的人正在路上

此时已莺飞草长 爱的人正在路上

我知他风雨兼程 途经日暮不赏

穿越人海 只为与你相拥

此刻已皓月当空 爱的人手捧星光

我知他乘风破浪 去了黑暗一趟

感同身受 给你救赎热望

此时已莺飞草长 爱的人正在路上

此时已莺飞草长 爱的人正在路上

我知他风雨兼程 途经日暮不赏

穿越人海 只为与你相拥

此刻已皓月当空 爱的人手捧星光

我知他乘风破浪 去了黑暗一趟

感同身受 给你救赎热望

知道你不能 还要你感受

知道你不能 还要你感受

让星光加了一点彩虹

当樱花开的纷纷扬扬

当世间美好 与你环环相扣

特别鸣谢:槿葵,我们的海报制作妹妹。

原唱:柏松

吉他:柏松

和声:柏松

录音:柏松

混音:张强