Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install software with yum

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to use yum to install software", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use yum to install software" bar!

Install the software using yum

Automatic installation of software packages (package management): solve dependency problems, automatically download software packages. Based on Cpact S architecture.

S: directly use the directory where the root of the CD is located (/ media/xxx/ or / mnt).

C: configure the yum source profile.

1 yum source classification

Local yum source (recommended): fast and stable.

Network yum source: full package, new version, but unstable and slow relative to the local yum source.

Common command combinations:

Yum clean all # clears the local source cache, which is a necessary operation.

Yum makecache # generates a local source cache to download package dependencies from the server locally, which saves time when querying for dependencies.

Yum list | more # lists all package files, which can be used with grep query package, such as yum list | grepkernel.

Yum search xxx # is similar to list, searching for a specific package name.

Yum provides path name # after obtaining the path of the XXX program through which XXX, with this command, you can know the exact name of the package installed to that path.

Yum info xxx # displays package xxx details, even if xxx is not installed.

Yum update kernel # upgrades the kernel with yum.

Yum update # fully upgrades the system.

Yum list available # lists all packages that can be installed on the upgrade source.

Yum list updates # lists all packages that can be updated on the upgrade source.

Yum list installed # lists the packages that have been installed

Yum install xxx # installs the xxx package. If you do not want to be prompted to press the y key to agree to the installation, you can follow the-y parameter, yum install-y xxx, immediately after install.

Yum grouplist # lists which packages have been installed locally and which packages have not been installed (locally).

Yum groupinstall xxx # install the package group.

Yum update xxx # upgrade the xxx package.

Yum remove xxx # uninstalls the xxx package. For example, package A depends on package B. when package An is uninstalled, it will not be uninstalled with package B. The-y parameter also applies to remove.

Yumdownloader xxx # only downloads the xxx package locally, but does not install it, and does not automatically resolve dependency issues.

.2 configure yum source profile

[root@xuegod63Packages] # cd / etc/yum.repos.d/

[root@xuegod63yum.repos.d] # cp rhel-source.repo rhel-source.repo.back

[root@xuegod63yum.repos.d] # mount / dev/cdrom / mnt/

[root@xuegod63yum.repos.d] # cat! $

Cat rhel-source.repo

[rhel-source]

Name=Red Hat EnterpriseLinux $releasever-$basearch-Source

Baseurl= file:///mnt/

# baseurl= ftp://192.168.1.63/pub/

# baseurl= http://192.168.1.63/pub/

Enabled=1

Gpgcheck=0

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Supplementary note:

[local-Server] # where serverid is used to distinguish different yum package libraries and must have a unique name.

Name=local-Server # is a description of the yum package library.

The directory where the baseurl= file:///mnt # repodata directory is located.

The # baseurl= file:///media/Server # RHEL5 repodata directory is located in Server.

Enabled=1 # is 1, which means it is enabled.

Gpgcheck=1

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

3 YUM usage

1 install a single package

Yumclean all # clear the yum cache

Yumlist # shows all packages that have been installed and can be installed

Yuminstall zsh # install szh related packages

2 install a set of software packages

Yum grouplist

Yum groupinstall "Development tools" # for example, install development tools

3 yum query

Yum list z * # is found in list.

Yum search zsh # looks up by keyword.

Yum provides # View package details.

4 Delete

Yum remove zsh

Add: several very good Linux system images / toolkit sites.

Mirrors.ustc.edu.cn

Mirrors.sohu.com

Www.rpmseek.com

Www.rpmfind.net

Rpm.pbone.net

Pkgs.repoforge.org

4 download package to keep cache

Yumdownload

Modify the yum configuration file, keep the cache, and use the rpm package of the installed program again.

Vim / etc/yum.conf

Keepcache=1

You can find the rpm package under / var/cache/yum

6 source code compilation and installation package

Premise: the system must be installed: development tools, development libraries.

Steps:

1 get source code package 2, decompress 3 configuration, and detect the installation environment

. / configure # check that the installation environment meets the requirements, and if there is no problem, generate the: Makefile file.

4 compilation

Make # reads the Makefile file when it compiles.

5 installation

# make install

Install the software package extundelete-0.2.4.tar.bz2

[root@xuegod63 ~] # tarjxvf extundelete-0.2.4.tar.bz2

[root@xuegod63extundelete-0.2.4] #. / configure

Configuring extundelete0.2.4

Configure: error: Can'tfind ext2fs library

[root@xuegod63 ~] # rpm-ivh / mnt/Packages/e2fsprogs-devel-1.41.12-11.el6.x86_64.rpm

[root@xuegod63extundelete-0.2.4] #. / configure

[root@xuegod63extundelete-0.2.4] # make # make clean files generated after clearing make.

[root@xuegod63extundelete-0.2.4] # make install

6 Delete

[root@xuegod63extundelete-0.2.4] # pwd

/ root/extundelete-0.2.4

[root@xuegod63extundelete-0.2.4] # make uninstall

Note: make uninstall is sometimes deleted and not clean, so it is recommended that you add a:-- prefix parameter in the configure step when installing. When deleting or backing up in this way, you can delete this directory directly.

Specify the installation path:

[root@xuegod63extundelete-0.2.4] #. / configure-prefix=/usr/local/extundelete-mk

[root@xuegod63extundelete-0.2.4] # make & & make install

Cd/usr/local/extundelete-mk/

Characteristics of software installation method:

Rpm+yum: convenient, low version of the software, good stability, convenient management. The disadvantage is that the performance is slightly poor.

Manual: please, the software version is new. The stability is slightly poor, the management is slightly poor. The performance is good.

4 install source code package 1 to view version

[root@xuegod63 ~] # cat/etc/redhat-release

Red Hat EnterpriseLinux Server release 6.2 (Santiago)

[root@xuegod63] # uname-m

X86_64

2 compilation

Rpmbuild-- rebuild lrzsz-0.12.20-27.1.el6.src.rpm # compiles the source files in src.rpm into executable binaries. If the execution is successful, a rpmbuild directory will be generated under the root user's home directory.

Generate the rpm file lrzsz-0.12.20-27.1.el6.x86_64.rpm in the / root/rpmbuild/RPMS/x86_64/ directory.

3 installation

Then comes the installation process of rpm:

Rpm-e lrzsz

Rpm-ivhrpmbuild/RPMS/x86_64/lrzsz-0.12.20-27.1.el6.x86_64.rpm

Thank you for your reading, the above is the content of "how to use yum to install software". After the study of this article, I believe you have a deeper understanding of how to use yum to install software, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report