admin 管理员组文章数量: 1184232
2023年12月19日发(作者:matlab怎么定义二元函数)
LINUX下安装软件方法命令方法1.通常Linux应用软件的安装包有三种:1) tar包,如。它是使用UNIX系统的打包工具tar打包的。2) rpm包,如。它是Redhat Linux提供的一种包封装格式。安装rpm包的命令是"rpm -参数,包管理工具
yum 。"3) deb包,如。它是Debain Linux提供的一种包封装格式。安装deb包的命令是"dpkg -参数",包管理工具 apt-get。2.包命名规则:大多数Linux应用软件包的命名也有一定的规律,它遵循:名称-版本-修正版-类型例如: 1) 意味着: 软件名称:software 版本号:1.2.3 修正版本:1 类型:,说明是一个tar包。2) 软件名称:software 版本号:1.2.3 修正版本:1 可用平台:i386,适用于Intel 80x86平台。
类型:rpm,说明是一个rpm包。 注:由于rpm格式的通常是已编译的程序,所以需指明平台。 3.包里的内容:一个Linux应用程序的软件包中可以包含两种不同的内容:1) 一种就是可执行文件,也就是解开包后就可以直接运行的。在Windows中所 有的软件包都是这种类型。安装完这个程序后,你就可以使用,但你看不到源程序。而且下载时要注意这个软件是否是你所使用的平台,否则将无法正常安装。2) 另一种则是源程序,也就解开包后,你还需要使用编译器将其编译成为可执行文件。这在Windows系统中是几乎没有的,因为Windows的思想是不开放源程序的。通常,用tar打包的,都是源程序;而用rpm、dpkg打包的则常是可执行程序。一般一个软件总会提供多种打包格式的安装程序的。你可以根据自己的情况来选择。包:整个安装过程可以分为以下几步:1) 取得应用软件:通过下载、购买光盘的方法获得;2) 解压缩文件:一般tar包,都会再做一次压缩,如gzip、bz2等,所以你 需要先解压。如果是最常见的gz格式,则可以执行:“tar
–xvzf软件包名”,就可以一步完成解压与解包工作。如果不是,则先用解压软件,再执行“tar –xvf 解压后的tar包”进行解包; 阅读附带的INSTALL文件、README文件;3) 执行“./configure”命令为编译做好准备;4) 执行“make”命令进行软件编译;5) 执行“makeinstall”完成安装;
6) 执行“makeclean”删除安装时产生的临时文件。7) 运行应用程序:一般来说,Linux的应用软件的可执行文件会存放在/usr/local/bin目录下!不过这并不是“放四海皆准”的真理,最可靠的还是看这个软件的 INSTALL和README文件,一般都会有说明。8) 卸载:通常软件的开发者很少考虑到如何卸载自己的软件,而tar又仅是完成打包的工作,所以并没有提供良好的卸载方法。有两个软件能够解决这个问题,那就是Kinstall和Kife,它们是tar包安装、卸载的黄金搭档 包:1) 操作系统:RedHat(Red Hat/Fedora)2) 常见的安装包格式 rpm包,安装rpm包的命令是“rpm -参数”3) 包管理工具 yum4) 支持tar包5.1rpm命令 安装: rpm –ivh 软件包名.rpm( -I 安装软件,-t测试安装,不是真的安装,-p显示安装进度,-f忽略任何错误,-U升级安装,-v检测套件是否正确安装) 卸载: rpm –e 软件名(注意使用的是软件名,而不是软件包名) 查询:查询当前系统安装的软件包: rpm –qa ‘*软件包名*’rpmrpm -Uvh
packages(s).rpmrpm -e packagedescriptioninstall/upgrade package file(s)emove packageshow all packages whose names contain the word
rpm -qa '*spell*'spell and already installed in systemrpm -q packageshow version of package installedrpm -q -i packageshow all package metadatarpm -q -i -p
show all package file's -q -f /path/filewhat package does file belongrpm -q -l packagelist where files were installed
rpm -e packageemove packageshow all packages whose names contain the word
rpm -qa '*spell*'spell and already installed in systemrpm -q packageshow version of package installedrpm -q -i packageshow all package metadatarpm -q -i -p
show all package file's -q -f /path/filewhat package does file belongrpm -q -l packagelist where files were installedrpm -q -l -p
list where files would be 2cpio
| cpio extract package files to current directory-idrpm -q --requires
list files/packages that package needspackagerpm -q --list packages that need package (see also
whatrequires
whatrequires)package 5.2yum命令 yumyum update
[package list]yum install
list] 包:1) 操作系统:Debian系列(Ubuntu)2) 常见的安装包格式 deb包,安装deb包的命令是“dpkg -参数”3) 包管理工具apt-get4) 支持tar包Descriptionupgrade specified packages (or all installed
packages if none specified)install latest version of package(s), Yum refreshes
each time it's usedremove specified packages from systemlist available packages from repositories
6.1dpkg命令 安装: dpkg –i 软件包名.deb 卸载: dpkg –e 软件名查询:查询当前系统安装的软件包: dpkg –l ‘*软件包名*’ dpkgdpkg -Gi package(s).debdpkg -r
package dpkg -l
'*spell*' dpkg -l
package dpkg -s
package dpkg -I
dpkg -S /path/file dpkg -L
package dpkg -c
dpkg -x
dpkg -s package |
grep ^Depends:dpkg --purge --dry-run package 6.2apt-get命令descriptioninstall/upgrade package file(s)emove packageshow all packages whose names contain the word
spell and already installed in systemshow version of package installedshow all package metadatashow all package file's metadatawhat package does file belonglist where files were installedlist where files would be installedextract package files to current directorylist files/packages that package needslist packages that need package (see also
whatrequires)
Apt-get命令只能用于在repositories中的包,不能用于处理自己下载的deb包,要想处理自己下载的deb包,只能用dpkg命令。apt-getDescriptionupgrade specified packages (or all installed
apt-get dist-upgradepackages if none specified)apt-get install
install latest version of package(s)
remove specified packages from system
list available packages from repositories[package list]包和deb包安装命令对比:TaskRed Hat/FedoraUbuntuAdding Removing and Upgrading PackagesYum refreshes
Refresh list of available packagesapt-get updateeach time it's usedyum install apt-get install
Install a package from a repositorypackage_namepackage_nameyum install
或者dpkg --install
Install a package filerpm -i -e apt-get remove
Remove a packagepackage_namepackage_nameapt-get -s
yum check-upgrade或者apt-Check for package upgradesupdateget -s dist-upgradeyum update或者apt-get dist-Upgrade packagesrpm -Uvh [args]upgradeapt-get dist-Upgrade the entire systemyum upgradeupgradePackage InformationGet information about an available yum search apt-cache search
packagepackage_namepackage_nameapt-cache
Show available packagesyum list availabledumpavailyum list installedList all installed packagesdpkg --list或者rpm -qayum info apt-cache show
Get information about a package
Upgrade the entire systemyum upgradeupgradePackage InformationGet information about an available yum search
packagepackage_nameapt-cache search
package_nameapt-cache
Show available packagesyum list availabledumpavailyum list installedList all installed packagesdpkg --list或者rpm -qayum info apt-cache show
Get information about a packagepackage_namepackage_nameGet information about an installed rpm -qi dpkg --status
packagepackage_namepackage_nameList files in an installed packagerpm -ql
package_nameList documentation files in an rpm -qd
installed packagepackage_nameList configuration files in an rpm -qc
installed packagepackage_nameShow the packages a given rpm -qR
package depends onpackage_nameShow other packages that depend rpm -q -on a given package (reverse whatrequires
dependency)[args]Package File InformationGet information about a package rpm -qpi
fit files in a package filerpm -qpl
t documentation files in a rpm -qpd
package fit configuration files in a package rpm -qpc
fi2cpio
Extract files in a |
cpio -vidFind package that installed a filerpm -qf filenameFind package that provides a yum provides
particular filefilenameMisc. Packaging System ToolsShow stats about the package cache-Verify all installed packagesrpm -VaRemove packages from the local yum clean
cache directorypackagesdpkg --listfiles
package_name--apt-cache
dependsapt-cache
rdependsdpkg --info
g --contents
--dpkg-deb --extract
dir-to-extract-todpkg --search
filenameapt-file search
filenameapt-cache statsdebsumsapt-get clean
Find package that installed a filerpm -qf filenameFind package that provides a yum provides
particular filefilenameMisc. Packaging System ToolsShow stats about the package cache-apt-cache statsVerify all installed packagesrpm -VadebsumsRemove packages from the local yum clean
apt-get cleancache directorypackagesRemove only obsolete packages
-apt-get autocleanfrom the local cache directoryRemove header files from the local
yum clean
cache directory(forcing a new apt-file purgeheadersdownload of same on next use)General Packaging System InformationPackage file extension*.rpm*.debRepository location configuration/etc/filenameapt-file search
filename
版权声明:本文标题:LINUX下安装软件方法命令方法 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1702991276a438724.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论