ubuntu软件中心与 命令行安装的差异

分享于 

4分钟阅读

ubuntu

  繁體

Ubuntu的软件包可以有三种方式:.deb文件,.run文件,以及压缩的ziptar的原始源代码,

大部分是.deb文件-它们是预编译的软件包,可供使用,命令行程序如aptapt-get将为你自动安装依赖项,事实上,软件中心也在使用apt-get作为后端,所以它会自动安装依赖。

.run文件通常是专有和编码的二进制文件,

对于原始源代码,你必须自己完成所有事情-构建软件和安装依赖项。

也存在一类称为容器的软件,

再说一次,取决于你在做什么。如果是从官方Ubuntu存储库安装软件,那么你可以简单地 sudo apt-get install my-software

如果要安装.deb软件包,可以使用dpkg命令或apt-get,以下是使用apt get安装google chrome deb包的示例,


$ sudo apt-get install ./google-chrome-stable_current_amd64.deb 


[sudo] password for xieerqi: 


Reading package lists... Done


Building dependency tree 


Reading state information... Done


Note, selecting 'google-chrome-stable' instead of './google-chrome-stable_current_amd64.deb'


The following NEW packages will be installed:


 google-chrome-stable


0 upgraded, 1 newly installed, 0 to remove and 54 not upgraded.


Need to get 0 B/50.0 MB of archives.


After this operation, 190 MB of additional disk space will be used.


Get:1 /home/xieerqi/下载/google-chrome-stable_current_amd64.deb google-chrome-stable amd64 53.0.2785.101-1 [50.0 MB]


Selecting previously unselected package google-chrome-stable.


(Reading database ... 476104 files and directories currently installed.)


Preparing to unpack .../google-chrome-stable_current_amd64.deb ...


Unpacking google-chrome-stable (53.0.2785.101-1) ...


Processing triggers for menu (2.1.47ubuntu1) ...


Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160701-0ubuntu1) ...


Rebuilding /usr/share/applications/bamf-2.index...


Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...


Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...


Processing triggers for mime-support (3.59ubuntu1) ...


Processing triggers for man-db (2.7.5-1) ...


Setting up google-chrome-stable (53.0.2785.101-1) ...


update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode


update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode


update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode


Processing triggers for menu (2.1.47ubuntu1) .



apt-get有什么好处?它有--purge选项,允许你删除与程序相关的内容, sudo apt-get remove google-chrome-stable--purge选项也会删除配置文件,这很方便,如果你的软件坏了,你想完全全新安装它,软件中心不能这样做,所以这是另一个区别。

如果正在处理.run文件,你需要使该文件可执行,并运行它,


$ sudo chmod +x ./software.run


$ sudo ./software.run




COM  COMM  Comma  命令行  Ubuntu  DIFF