设为首页 收藏本站
查看: 353|回复: 0

[经验分享] 关于Ubuntu/debian下软件包管理工具用法和Redhat/CentOS系列的比较

[复制链接]

尚未签到

发表于 2018-4-30 08:48:59 | 显示全部楼层 |阅读模式
  这里记录借鉴参考centos系统的管理理论,类比学习ubuntu系统的基本管理。
  参考文献:SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora
  https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/%20RedHatEnterpriseLinuxAndFedora
  关于Ubuntu下apt的一些用法及和yum的比较
  http://blog.sina.com.cn/s/blog_49b1f7210102vepr.html
  Ubuntu系统中apt命令的用法汇总
  http://www.xitongzhijia.net/xtjc/20150109/34463.html
  It is easy to apply your existing knowledge of Red Hat Enterprise Linux or Fedora to Ubuntu. The key differences between them are covered in this article.
Administrative Tasks
  In Red Hat Enterprise Linux and Fedora by default, each administrative user needs to know the root password, in addition to their own password.
  In Ubuntu, each user only has one password. Users in the admingroup can run command line and graphical applications with elevated privileges. Graphical admin tools prompt for this password when run, andcommand line tools can be run with root-privileges using sudo.
Package Management
  Ubuntuhas more packages available than Fedora, so you'll have a better chanceof finding what you want in the repositories. As with Fedora, graphicalapplications will put a link into the Applications menu.
Graphical Tools
  The Synaptic package Manager is an excellent tool for finding, fetching and installing packages. Press System -> Administration -> Synaptic Package Manager to start Synaptic.
Command Line Tools
  Ubuntu uses apt-get instead of yum, up2date and so on to find, download, and install packages and their dependencies.
  Notethat, unlike yum, apt-get is only for packages available in repositories - it cannot handle packages you have already downloaded. The dpkg command is used instead.
Table of Equivalent Commands
  Below is a table of equivalent commands for package management on both Ubuntu/Debian and Red Hat/Fedora systems.
  Task
  Red Hat/Fedora
  Ubuntu
  Adding, Removing and Upgrading Packages
  Refresh list of available packages
  Yum refreshes each time it's used
  apt-get update
  Install a package from a repository
  yum install package_name
  apt-get install package_name
  Install a package file
  yum install package.rpm
  rpm -i package.rpm
  dpkg --install package.deb
  Remove a package
  rpm -e package_name
  apt-get remove package_name
  Remove a package with configuration files
  yum remove package_name
  apt-get purge package_name
  Check for package upgrades
  yum check-update
  apt-get -s upgrade
  apt-get -s dist-upgrade
  Upgrade packages
  yum update
  rpm -Uvh [args]
  apt-get upgrade
  Upgrade the entire system
  yum upgrade
  apt-get dist-upgrade
  Package Information
  Get information about an available package
  yum search package_name
  apt-cache search package_name
  Show available packages
  yum list available
  apt-cache dumpavail
  List all installed packages
  yum list installed
  rpm -qa
  dpkg --list
  Get information about a package
  yum info package_name
  apt-cache show package_name
  Get information about an installed package
  rpm -qi package_name
  dpkg --status package_name
  List files in an installed package
  rpm -ql package_name
  dpkg --listfiles package_name
  List documentation files in an installed package
  rpm -qd package_name
  -
  List configuration files in an installed package
  rpm -qc package_name
  dpkg-query --show -f '${Conffiles}\n' package_name
  Show the packages a given package depends on
  rpm -qR package_name
  apt-cache depends
  Show other packages that depend on a
  given package (reverse dependency)
  rpm -q --whatrequires [args]
  apt-cache rdepends
  Package File Information
  Get information about a package file
  rpm -qpi package.rpm
  dpkg --info package.deb
  List files in a package file
  rpm -qpl package.rpm
  dpkg --contents package.deb
  List documentation files in a package file
  rpm -qpd package.rpm
  -
  List configuration files in a package file
  rpm -qpc package.rpm
  -
  Extract files in a package
  rpm2cpio package.rpm | cpio -vid
  dpkg-deb --extract package.deb dir-to-extract-to
  Find package that installed a file
  rpm -qf filename
  dpkg --search filename
  Find package that provides a particular file
  yum provides filename
  apt-file search filename
  Misc. Packaging System Tools
  Show stats about the package cache
  -
  apt-cache stats
  Verify all installed packages
  rpm -Va
  debsums
  Remove packages from the local cache directory
  yum clean packages
  apt-get clean
  Remove only obsolete packages from the local cache directory
  -
  apt-get autoclean
  Remove header files from the local cache directory
  (forcing a new download of same on next use)
  yum clean headers
  apt-file purge
  General Packaging System Information
  Package file extension
  *.rpm
  *.deb
  Repository location configuration
  /etc/yum.conf
  /etc/apt/sources.list
  Some of the information in this table was derived (with permission) from APT and RPM Packager Lookup Tables.
  More technical information about Debian-style packaging can be found in Basics of the Debian package management system and the Debian New Maintainers' Guide.
Services
  Services on Ubuntu are managed in a broadly similar way to those on Red Hat.
Graphical Tools
  Services can be configured by clicking System -> Administration -> Services. A tool called Boot-Up Manager is also available.
Command Line Tools
  Below is a table of example commands for managing services. The apache/httpd service is used as an example.
  Task
  Red Hat / Fedora
  Ubuntu
  Ubuntu
  (with sysv-rc-conf or sysvconfig)
  Starting/stopping services immediately
  service httpd start
  invoke-rc.d apache start
  service apache start
  Enabling a service at boot
  chkconfig httpd on
  update-rc.d apache defaults
  sysv-rc-conf apache on
  Disabling a service at boot
  chkconfig httpd off
  update-rc.d apache purge
  sysv-rc-conf apache off
  Note: Whereas Red Hat and Fedora servers boot into runlevel 3 by default, Ubuntu servers default to runlevel 2.
  Note: The service and invoke-rc.d commands call init scripts to do the actual work.  You can also start and stop services by doing e.g. /etc/init.d/apache start on Ubuntu, or /etc/init.d/httpd start on Red Hat/Fedora.
Network
Graphical Tools
  Fedora/RHEL have system-config-network, ubuntu pre 10.04 had gnome-nettoolto edit static ip address, since 10.04 nm-connection-editor is the bestchoice. For Ubuntu 10.04 Studio there is only manual editing of files since NetworkMontor is not included
Command Line Tools
  * ubuntu networking for basic and advanced users

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-453851-1-1.html 上篇帖子: docker on ubuntu16.10安装配置 下篇帖子: ubuntu安装phpMyAdmin for MySQL
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表