首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

dpkg命令

大家好,又见面了,我是你们的朋友全栈君。dpkg命令 如果ubuntu要安装新软件,已有deb安装包(例如:iptux.deb),但是无法登录到桌面环境。那该怎么安装?答案是:使用dpkg命令。 dpkg命令常用格式如下: sudo dpkg -I iptux.deb#查看iptux.deb软件包的详细信息,包括软件名称、版本以及大小等(其中-I等价于–info) sudo dpkg -c iptux.deb#查看iptux.deb软件包中包含的文件结构(其中-c等价于–contents) sudo dpkg -i iptux.deb#安装iptux.deb软件包(其中-i等价于–install) sudo dpkg -l iptux#查看iptux软件包的信息(软件名称可通过dpkg -I命令查看,其中-l等价于–list) sudo dpkg -L iptux#查看iptux软件包安装的所有文件(软件名称可通过dpkg -I命令查看,其中-L等价于–listfiles) sudo dpkg -s iptux#查看iptux软件包的详细信息(软件名称可通过dpkg -I命令查看,其中-s等价于–status) sudo dpkg -r iptux#卸载iptux软件包(软件名称可通过dpkg -I命令查看,其中-r等价于–remove) 注:dpkg命令无法自动解决依赖关系。如果安装的deb包存在依赖包,则应避免使用此命令,或者按照依赖关系顺序安装依赖包。

02

package-cleanup

为什么这么说呢? 卸载deb包时候,可以连不要的依赖关系包一起删除,但是多如牛毛的rpm却不可以。 这个真的是rpm的痛! yum仅仅能在线安装rpm,但是只能在安装的时候解决依赖关系,卸载的时候却不行。 不过,有个工具可以专门解决rpm依赖关系:package-cleanup Options:   -h, --help           show this help message and exit   --problems           List dependency problems in the local RPM database   --leaves             List leaf nodes in the local RPM database   --all                When listing leaf nodes also list leaf nodes that are                        not libraries   --orphans            List installed packages which are not available from                        currenly configured repositories.   -q, --quiet          Print out nothing unecessary   -y                   Agree to anything asked   -d, --dupes          Scan for duplicates in your rpmdb   --cleandupes         Scan for duplicates in your rpmdb and cleans out the                        older versions   --oldkernels         Remove old kernel and kernel-devel packages   --count=KERNELCOUNT  Number of kernel packages to keep on the system                        (default 2)   --keepdevel          Do not remove kernel-devel packages when removing                        kernels   -c CONFFILE          config file location Please specify either --problems, --leaves, --orphans or --oldkernels 例如,你不小心安装了gnome-games,然后马上把这个卸载。你会发现只卸载了gnome-games,那些“包庇”gnome-games的“同党”还留在你的硬盘里! 这时,你输入:package-cleanup --leaves 就会列出一系列的关系包,都是在rpm数据库里没有被依赖的依赖包。 把这些包统统remove,你的硬盘从此干净了。

01
领券