Ubuntu 软件安装

1. 使用dpkg命令 安装 deb包
 dpkg 命令常用格式如下:
 sudo dpkg -i fakeroot.deb
 #安装fakeroot.deb软件包(其中-i等价于--install)
 sudo dpkg -I fakeroot.deb
 #查看fakeroot.deb软件包的详细信息,包括软件名称、版本以及大小等(其中-I等价于--info)
 sudo dpkg -c fakeroot.deb
 #查看fakeroot.deb软件包中包含的文件结构(其中-c等价于--contents)
 sudo dpkg -l fakeroot.deb
 #查看fakeroot软件包的信息(软件名称可通过dpkg -I命令查看,其中-l等价于--list)
 sudo dpkg -L fakeroot
 #查看fakeroot软件包安装的所有文件(软件名称可通过dpkg -I命令查看,其中-L等价于--listfiles)
 sudo dpkg -s fakeroot
 #查看fakeroot软件包的详细信息(软件名称可通过dpkg -I命令查看,其中-s等价于--status)

sudo dpkg -r fakeroot

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

 -r, --remove, -P, --purge package...|-a|--pending  #Remove an installed package.

 -r or --remove remove  everything  except  conffiles.  This  may avoid having to reconfigure the package if it is reinstalled later. (Conffiles are configuration files that are listed in the DEBIAN/conffiles  control  file).  

-P  or  --purge  removes everything,  including conffiles. If -a or --pending is given instead of a package name, then all packages unpacked, but marked to be removed or purged in file  /var/lib/dpkg/status,  are removed  or  purged,  respectively.  

Note:  some configuration files might be unknown to dpkg because they are created and handled separately through the configuration  scripts.  In that case,  dpkg  won't remove them by itself, but the package's postrm script (which is called by dpkg), has to take care of their removal during purge. Of course, this only applies to  files in system directories, not configuration files written to individual users' home directories.

Removing of a package consists of the following steps:
     1. Run prerm script
     2. Remove the installed files
     3. Run postrm script

Note: deb 是debian linus的安装格式,跟 red hat 的rpm非常相似,最基本的安装命令是:dpkg -i file.deb或者直接双击此文件,dpkg命令无法自动解决依赖关系,如果安装的deb包存在依赖包,则应避免使用此命令,或者按照依赖关系顺序安装依赖包;
dpkg 是Debian Package 的简写,是为Debian专门开发的套件管理系统,方便软件的安装、更新及移除。所有源自Debian的Linux发行版都使用dpkg,例如Ubuntu、Knoppix 等。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值