Update commands for software under Linux

Source: Internet
Author: User
Tags curl gpg

Update commands for software under Linux

When installing packages under Ubuntu Server, you often use the sudo apt-get install package name or sudo pip install package name, then what is the difference between the two?


1. Differences
The PIP is used to install all the Python dependencies from PyPI (https://www.python.org/) and can optionally install any previous versions of the dependencies that have been uploaded on PyPI, which are personally considered Python-related packages and third-party packages, as well as various versions;

Apt-get can be used to install software, update the source, or can be used to update a typical dependency package from Ubuntu (Https://launchpad.net/ubuntu), which means that it is just a single version of the installation (newly released, or most recent), And we cannot decide which version of the dependent package we want to install or the version before it is selected.
Personally, it's a good distinction: after all, one is to update a system-level package, one to update a programming language Level Pack (library).


2. Use
This is the case, if you need the latest version of the Python dependency package, you can use Apt-get directly, when the project suddenly need to use the old version of the dependency package, you can use Virtualenvwrapper and Pip to perfect the installation of an older version of the dependency package;
You can choose the type of installation you prefer according to your preference. However, if you need to install a specific version of a Python package, or install a package in Virtualenvwrapper, or install a package that only hosts PyPI, only Pip will help you solve the problem. Otherwise, if you don't mind installing in a system-wide location using Apt-get or Pip are OK;


3. Installation and application
Apt-get can be used directly, in the form of

$ sudo apt-get install/delete package$ sudo apt-get -F install                                   #修复安装 $ sudo apt-< C5>get dist-upgrade                                 #升级系统 $ sudo apt-get  upgrade                                      #更新已安装的包 $ apt-get  Source Package                                    #下载该包的源代码 $ sudo apt-get build-DEP package                            #安装相关的编译环境 $ sudo Apt-get clean && sudo apt-get autoclean              #清理无用的包

Pip needs to be installed to use, with virtualenvwrapper will be icing on the cake. The installation process is as follows (for Ubuntu 10.10 and later) in the format: Pip install package.

$ sudo apt-get install Python-pip python-dev build-----upgrade virtualenv


Question What is the problem with
1.rpm? What are the advantages of
2.yum?
What is the similarities between the 3.apt-get and Yum?

When we use Cloudera and OpenStack, we often see Yum, apt-get, RPM, what are they? Here's a look at this.

RPM is a package management method developed by Red Hat, which allows us to install, query, uninstall, and upgrade the software conveniently. However, the dependencies between RPM packages are often cumbersome, especially when the software is made up of multiple RPM packages. The

Yum (Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and Redhat as well as in SuSE. Based on RPM package management, the ability to automatically download the RPM package from the specified server and install, can automatically handle dependency relationships, and install all dependent software packages at once, without the tedious download and installation.


RPM is a software package name for Linux, with the. RMP end, the installation syntax is: RPM-IVH,RPM package installation has a big drawback is that the file is too large, sometimes installed a software to install a lot of other packages, very troublesome, So Redhat Little Red Hat developed the Yum installation method, he can completely solve the problem of relevance, it is convenient, as long as the configuration of two files can be installed, installation method is: Yum-y install, Yum is not a package, but the software to install the package


Simple Point said , RPM can only install RPM packages that have already been downloaded to the local machine. Yum can download and install RPM packages online, update the system, and automatically handle dependencies between packets and packages, which is not available in the RPM tool.

Yum and apt-get the same point:
Apt-get belongs to Ubuntu, Debian Package management tool

Yum belongs to Redhat, CentOS Package management tool   

Knowing these two points, there's no problem with using Hadoop or OpenStack. For more detailed reference:

Generally known Linux systems are basically divided into two main categories:  

12




RedHat Series
1 common installation package format RPM package, the command to install RPM package is "rpm-parameter"

2 Package management Tools Yum

3 Support for TAR packages


Debian series
1 Common installation package format Deb package, the command to install the Deb package is "dpkg-parameters"

2 Package Management Tools Apt-get

3 Support for TAR packages

Tar is only a compressed file format, so it just packs the files.
RPM is the equivalent of an installation file in Windows that automatically handles dependencies between packages.

The pros and cons, RPM is generally pre-compiled files, it may have been bound to some kind of CPU or distribution above.
Tar generally includes compilation scripts, which you can compile in your environment, so it's universal.

If your package does not want to open the source code, you can make rpm, if open source, with tar more convenient.

Tar is usually the source of the software package, you need to unpack, and then install the trilogy,./configure, make, do install. To install the software.

RPM is a software package management mechanism of Redhat company, which can be installed and deleted directly through RPM command, and the biggest advantage is that it automatically handles the possible dependencies of various packages within itself.

--------------------------------

Binary packages in *.rpm form [CentOS]

Installation: Rpm-ivh *.rpm

Uninstall: Rpm-e Packgename

Rpm-q Nginx to see if you have installed

Upgrade: RPM-UVH XXX

Inquire:
To query all installed packages: RPM-QA
Query a package: RPM-QA | grep xxx
Rpm-qi xxx
The installation path of the query software: RPM-QL XXX
RPM-QC xxx
Querying a file is the RPM package generated: rpm-qf/etc/yum.conf
Rpm-qpi xxx

Rpm-qa|grep PHP to view installed RMP packages


Installation: Rpm-ivh XXX
Removal: rpm-e XXX
Upgrade: RPM-UVH XXX

Inquire:
To query all installed packages: RPM-QA
Query a package: RPM-QA | grep xxx
Rpm-qi xxx
The installation path of the query software: RPM-QL XXX
RPM-QC xxx
Querying a file is the RPM package generated: rpm-qf/etc/yum.conf
Rpm-qpi xxx


--------------------------------

SRC.RPM installation and uninstallation of source code distribution packages

The distribution of the source code of the Linux software refers to the release form of all the program sources of the software, which requires the user to compile the executable binary code and install it, the advantage is that the configuration is flexible, can remove or retain certain functions/modules, adapt to a variety of hardware/operating system platform and compiling environment, the disadvantage is difficult , generally not suitable for beginners to use.

1, *.src.rpm form of source code package

Installation: Rpm-rebuild *.src.rpm

Cd/usr/src/dist/rpms

RPM-IVH *.rpm

Uninstall: Rpm-e Packgename

Description: The rpm–rebuild *.src.rpm command compiles the source code and generates a binary RPM package under/usr/src/dist/rpms, and then installs the binary package. Packgename as mentioned earlier.



--------------------------------

Dpkg "Ubuntu"

Dpkg-l | grep ' php ' uses dpkg-l to view installed software

Dpkg is a shorthand for the debian["package". A suite management system specifically developed for Debian to facilitate the installation, updating and removal of software. All Linux distributions originating from Debian use dpkg, such as Ubuntu, Knoppix, and so on.
Here are some common uses of Dpkg:
   1. Dpkg-i <package.deb>
Install a Debian package, such as files you have manually downloaded.
   2. Dpkg-c <package.deb>
List the contents of <package.deb>.
   3. Dpkg-i <package.deb>
Extract package information from <package.deb>.
   4. Dpkg-r <package>
Remove a package that has already been installed.
   5. Dpkg-p <package>
Completely clears an installed package. Unlike remove, remove just deletes the data and executable files, and purge also removes all the configuration files.
   6. Dpkg-l <package>
List all files that are <package> installed. Also see Dpkg-c to check the contents of a. deb file.
   7. Dpkg-s <package>
Displays information about the packages that have been installed. Also see Apt-cache displays the package information in the Debian archive, as well as dpkg-i to display the package information extracted from a. deb file.
   8. Dpkg-reconfigure <package>
Reconfigure an already installed package if it is using debconf (debconf provides a unified configuration interface for package installation).



--------------------------------

Use Yum and Apt-get. Upgrade of software management methods.

The Yum configuration file is/etc/yum.conf


1. Let's first talk about Redhat's high-level package management of Yum.

Yum install gcc [CentOS]

Update: Yum update installation: Yum install xxx remove: Yum remove xxx Clears files that have already been installed (/var/cache/yum/



#sudo-S
#LANG =c
#yum-y install gcc gcc-c autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel L IBXML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl Curl -devel

Installing packages with Yum

Command:

Yum Install <package_name>

Remove packages with Yum
Command:

Yum-y Remove httpd*   


Command:


List all packages that can be installed
Command:


List all packages that can be updated
Command:

Yum list Updates


List all installed packages
Command:


List all packages installed but not in Yum Repository
Command:


Lists the packages that you specify
Command:


Yum = Yellow Dog Updater, Modified
The main function is more convenient to add/remove/update RPM packages.
It can automatically solve the dependency problem of the package.
It makes it easy to manage a large number of system update issues

Yum Features
Multiple repositories can be configured at the same time (Repository)
Concise configuration file (/etc/yum.conf
Automatic resolution of dependency issues encountered when adding or removing RPM packages
Easy to use
Maintaining consistency with the RPM database

Yum Installation
CentOS comes with (yum-*.noarch.rpm)


Before you first enable Yum, you first need to import the system's Rpm-gpg-key:

#rpm--import/usr/share/doc/centos-release-3(4)/rpm-gpg-key-centos-3(4


Yum Instructions
Note: When using the Yum or Yum repositories for the first time, Yum will automatically download all required headers placed in the/var/cache/yum directory, which may take a long time.

Update for RPM packages
Check for updatable RPM packages

#yum check-update


Update all RPM Packages


Update specified RPM packages, such as update kernel and kernel source


A large-scale version upgrade, unlike Yum Update, even the old obsolete package is upgraded


Installation and removal of RPM packages
Install RPM packages, such as Xmms-mp3

#yum Install Xmms-mp3


Remove RPM packages, including packages that are dependent on the package


Note: You will also be prompted to delete Licq-gnome,licq-qt,licq-text

Related parameters for Yum staging (/var/cache/yum/)
Clear the Staging RPM package file

#yum Clean Packages


Purge the RPM header files in the staging


Clear the old RPM header files in the staging


Purge old RPM header files and package files in staging


Note: equivalent to yum clean packages + Yum clean oldheaders

Package List
List all RPM packages that can be installed or updated in the repository


Lists the specific RPM packages that can be installed or updated and installed in the repository

#yum list Mozilla#yum list mozilla*


Note: You can use a match in the RPM package name, such as listing all RPM packages that start with Mozilla
List all RPM packages that can be updated in the repository


List all RPM packages that have been installed


List RPM packages that have been installed but are not included in the repository


Note: Download the installed RPM package from other websites

RPM Package Information display (info parameter with list)
List all the RPM packages that can be installed or updated in the repository


Lists the specific information in the repository that can be installed or updated and the RPM packages that have been installed


Note: You can use a match in the RPM package name, such as listing all the RPM packages that start with Mozilla
List information about all RPM packages that can be updated in the repository


List all the RPM packages that have been installed


Lists information about the RPM packages that have been installed but are not included in the repository


Note: Download the installed RPM package information from other websites

Search RPM Packages
Search for RPM packages that match specific characters


Note: Search in RPM Package name, package description, etc.
Search for RPM packages with a specific file name


Add Resource Library
Example: Add rpm.livna.org as a resource library
Install livna.org RPMs GPG key

#rpm--import http://


Check GPG Key


Display key Information


(Note: If you want to remove key, use #rpm-e gpg-pubkey-a109b1ec-3f6e28d5)

Common commands for Yum

# yum install xxx            install xxx software # yum info xxx                view xxx software info # yum Remove xxx        Remove package # Yum list                        List package # Yum Clean
     clear buffer and on the package # YUM provides xxx        with XXX for keyword search package (information provided for keywords) # yum search xxx           



These three are all a set of upgrade lists and deletions for the organization: For example, "Mysql Database" is a group that will operate all related packages at the same time;

# Yum Update                system upgrade # Yum list available        lists all the packages on the upgrade source; # Yum list updates         lists all the update packages available on the upgrade source; # Yum List installed
    
      List the packages that have been installed; # Yun update kernel       
    


Common sources for Yum

1) automatic selection of the fastest source

Because Yum has mirror speed is very slow, if Yum chooses this mirror, this time Yum will be very slow, in this case, you can download the Fastestmirror plugin, it will automatically select the fastest mirror:



Configuration file:


The speed test log file for your yum Image:

/var



(2) Yum with graphical interface

If you feel that the command line Yum is inconvenient, then you can use the graphical Yumex, which looks more convenient because you are free to select repositories:


The Yum Extender can then be seen in the system tools. In fact, the system comes with the "Add/Remove Programs" can also achieve graphical software installation, but some Yumex features it does not.



2. Talk about advanced package management methods in Ubuntu Apt-get


Configuration file/etc/apt/sources.list


For the server edition, it is recommended to use aptitude to view, install, remove the Deb package
sudo apt-get install aptitude
Then execute sudo aptitude into management

You can also use commands:

aptitude Update Updates available packages list aptitude Upgrade upgrade available Packages Aptitude Dist-string





Considering the compatibility of the system, and the above is relatively large, do not find the latest version, directly with the Apt-get install XXX installed. Because our Ubuntu is dailybulid, the contents of the CD are basically the latest. No need to re-download. Be sure to get the latest version, Apt-get update the repository before updating the software, and then Apt-get install.


Common APT Command parameters:

apt-Cache Search Package Search packages apt-Cache Show Package get information about packages, such as description, size, version, etc. sudo apt-GetInstall package sudo apt-GetInstall Package--Reinstall reinstall Package sudo apt-Get-F Install Repair installation"- F =--fix-missing"sudo apt-GetRemove Package Delete packages sudo apt-GetRemove Package--Purge Delete package, including delete config file etc sudo apt-Getupdate updates source sudo apt-Getupgrade updating an installed package sudo apt-Getdist-upgrade upgrade system sudo apt-Getdselect-upgrade using Dselect to upgrade apt-Cache depends package understands the use of dependent apt-the Cache Rdepends package is a view of which packages are dependent on sudo apt-Getbuild-DEP Package Installation-related compilation environment apt-GetSource package Download the source code for this bundle sudo apt-GetClean && sudo apt-GetAutoClean Clean up the useless package sudo apt-GetCheck to see if there is a corrupted dependency

Update commands for software under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.