在ubuntu系统中使用dpkg命令安装后缀名为deb的软件包
发布日期:2021-06-30 17:51:09 浏览次数:4 分类:技术文章

本文共 2174 字,大约阅读时间需要 7 分钟。

在ubuntu系统中使用dpkg命令安装后缀名为deb的软件包:

dpkg命令常用格式如下:

#查看文件结构(其中-c等价于--contents)

sudo dpkg -c xx.deb

#安装软件包(其中-i等价于--install)

sudo dpkg -i xx.deb

#查看软件包的信息(软件名称可通过dpkg -I命令查看,其中-l等价于--list)

sudo dpkg -l xx

#查看软件包安装的所有文件(软件名称可通过dpkg -I命令查看,其中-L等价于--listfiles)

sudo dpkg -L xx

#查看软件包的详细信息(软件名称可通过dpkg -I命令查看,其中-s等价于--status)

sudo dpkg -s xx

#卸载软件包(软件名称可通过dpkg -I命令查看,其中-r等价于--remove)

sudo dpkg -r xx

Commands:

  -i|--install               <.deb file name> ... | -R|--recursive <directory> ...

  --unpack                <.deb file name> ... | -R|--recursive <directory> ...
  -A|--record-avail  <.deb file name> ... | -R|--recursive <directory> ...
  --configure            <package> ... | -a|--pending
  --triggers-only      <package> ... | -a|--pending
  -r|--remove           <package> ... | -a|--pending
  -P|--purge             <package> ... | -a|--pending
  -V|--verify <package> ...        Verify the integrity of package(s).
  --get-selections [<pattern> ...] Get list of selections to stdout.
  --set-selections                 Set package selections from stdin.
  --clear-selections               Deselect every non-essential package.
  --update-avail       <Packages-file>   Replace available packages info.
  --merge-avail        <Packages-file>    Merge with info from file.
  --clear-avail                    Erase existing available info.
  --forget-old-unavail             Forget uninstalled unavailable pkgs.
  -s|--status <package> ...        Display package status details.
  -p|--print-avail <package> ...   Display available version details.
  -L|--listfiles <package> ...     List files `owned' by package(s).
  -l|--list [<pattern> ...]        List packages concisely.
  -S|--search <pattern> ...        Find package(s) owning file(s).
  -C|--audit                       Check for broken package(s).
  --add-architecture <arch>        Add <arch> to the list of architectures.
  --remove-architecture <arch>     Remove <arch> from the list of architectures.
  --print-architecture             Print dpkg architecture.
  --print-foreign-architectures    Print allowed foreign architectures.
  --compare-versions <a> <op> <b>  Compare version numbers - see below.
  --force-help                     Show help on forcing.
  -Dh|--debug=help                 Show help on debugging.
  -?, --help                       Show this help message.
      --version                    Show the version.

注:dpkg命令无法自动解决依赖关系。如果安装的deb包存在依赖包,则应避免使用此命令,或者按照依赖关系顺序安装依赖包。

如果要查找某一个已经安装了的deb,比如查qq这个软件,可以进行一下模糊查询:

dpkg -l | grep qq

查找路径或者文件

dpkg -S *mysql*

转载地址:https://liangyihuai.blog.csdn.net/article/details/49229685 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux目录解释
下一篇:使用HDFS API实现hadoop HDFS文件系统的基本操作

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月20日 23时03分07秒