Install yum linux centos

How to install yum on a Virtual Server

Many Linux distributions use a variant of yum. All CentOS releases are shipped with yum and a certain set of matching configuration files. In part this permits your system to work with the CentOS world-wide mirror and updates system. Some downstream forks break these yum configurations, and make their system incompatible.

For the reasons we will see later in this article, CentOS support regulars will decline to make a bad situation (a broken yum), worse.

2. I don’t have yum on my CentOS installation

If yum is not installed and working, it is not CentOS. If you have a installation ‘based on’ or ‘derived from’ CentOS, but yum is missing, you don’t have a real CentOS installation. It is not really possible for non-developers to install CentOS without installing yum.

Several VPS (Virtual Server) providers and some downstream forks of CentOS and its management tools (think: OpenVZ, cPanel, Plesk, webmin, Direct Admin, BlueQuartz, Asterisk, Trixbox, Elastix) seem to install only parts of CentOS on their virtual servers. Some then also remove yum from the installation, or alter the settings of the yum configurations. The usual alterations are to ‘exclude’ certain locally modified packages from yum package management. The command: >> usually discloses the excluded matter. Some ‘manage’ the box outside of the package management system. See also the [http://wiki.centos.org/AdditionalResources/OtherVoices Other Voices] page for a list of more fork tines, derived in whole or in part from CentOS.

Why they do it is unclear. Maybe they try to make it harder for you to overwrite their kernel. Perhaps they do it from ignorance or sloth. The CentOS view of this is that such an approach is ill-considered. yum has mechanisms to protect specific packages from change. Perhaps, they cannot figure out how to read: man yum for the ‘exclude’ option; or perhaps they want to avoid support calls and are willing to sell a system which cannot be updated with facility. The second way, when the machine gets compromised though some newly emerged exploit which they prevented patching away, they can charge you for a full reinstall or restore from backups.

<! data-lazy-src=

3. You are saying I was lied to and mislead?

Yes. A true CentOS installation has a CentOS kernel, the CentOS centos-release package, the CentOS yum package and no modification or additions to the contents of the /etc/yum.repos.d/ directory [other than possibly a local mirror, or staged and not-enabled adjunct repositories]. All dependencies will be satisfied and, except for configuration files (see: man rpm), a

command will run silently except for expected configuration file changes. (See: man rpm for help in reading such a listing, where there is a decoder for the left hand column details.)

A true CentOS system also may be freely updated at any time. We note this requirement because security fixes also issue asynchronously. One indication that there may be a problem is that the rack hosting vendor offers CentOS 4.X (where X is a digit), rather than CentOS 4, and so forth; the CentOS team (and indeed the upstream distribution stabilizer) do not permit ‘holding back’ at a non-current, prior ‘point’ version, and still representing the product as the ‘genuine’ article.

A quick test to see if yum is providing expected answers is this:

which will return a full list of available package groups on CentOS 4 and CentOS 5.

Members of the #centos IRC channel on irc.freenode.net will often ask you to perform that test, or a couple of other related tests with:

$ lsb_release -a ; uname -a ; rpm -V yum centos-release ; ls /etc/yum.repos.d/ ; yum repolist all

which produces multi-line output. That complete set of output (it should only be a few lines — under ten, unless things are seriously wrong) should be placed in the CentOS pastebin and the channel advised of the specific URL at which the content appears. Alternatively, a quick determination may sometimes be attempted with the one line result producing:

which can properly be pasted in full in the #centos IRC channel. In either case, this information is sought in order to help quickly diagnose this state of affairs.

When it is clear that there is a non-CentOS installation in play, the regular and ‘in the know’ members of the IRC channel will not continue to offer further advice. They do not wish either to suggest a course which may potentially break your system further, or to ‘spoonfeed’ people who will not learn better system administration; the regulars cannot and do not know all the ways rack hosting providers may have altered the functions which a true CentOS environment provides at any point in time.

  • Stop misrepresenting what they offer as CentOS.
  • Deliver to you what they promised or return your money.
Читайте также:  Office 365 linux ubuntu

4. Installing yum

Okay, okay — I get it — it is not CentOS. But, I still want yum, or to try to remove and repair a crippled set of yum configurations.

<! data-lazy-src=

We assume in this example a CentOS 4 release and retrieve that proper centos-release rpm into /tmp/unpack with wget:

$ # . as an end user $ cd /tmp $ mkdir unpack $ wget http://mirror.centos.org/centos-4/4.6/os/i386/CentOS/RPMS/centos-release-4-4.4.i386.rpm $ mkdir -p /tmp/unpack/var/lock/rpm/ $ # this is a very unusual case (an 'out of tree' RPM --root), where it is $ # NOT improper to use --nodeps $ sudo rpm -Uvh --root /tmp/unpack/ --nodeps centos-release*rpm $ # . become root $ su - # cd /etc/yum.repos.d/ # mkdir attic # mv *.repo attic/ # cp /tmp/unpack/etc/yum.repos.d/* .

and you will have a pristine CentOS yum repository setup once again. As we are done with the ‘out of tree’ unpacking of the relacement configurations, we can do: rm -rf /tmp/unpack to clean up after the process.

Sometimes people come to the IRC channel seeking help for a box that was represented by a hosting firm as being a CentOS install, but is not running yum properly, or not picking up updates that have been released to the mirror network after the usual propagation delays. This page offers a quickstart to seeing the detail that the regulars in the channel recognize as common CentOS forgeries.

TipsAndTricks/BrokenVserver (последним исправлял пользователь анонимно 2019-12-09 09:11:35)

Источник

Установка yum для Linux CentOS 5

Нередко, при покупке VDS с Linux CentOS 5 пользователи сталкиваются с проблемой установки дополнительных программ с помощью удобного пакетного менеджера yum.
Конечно, можно использовать для этого всеми известный rpm, но.. Зачем, если есть yum?

Потребуются следующие пакеты:

  1. yum-3.0.5-1.el5.centos.5.noarch.rpm
  2. yum-metadata-parser-1.0-8.fc6.i386.rpm
  3. python-sqlite-1.1.7-1.2.1.i386.rpm
  4. python-elementtree-1.2.6-5.i386.rpm
  5. python-urlgrabber-3.1.0-2.noarch.rpm
  6. rpm-python-4.4.2-47.el5.i386.rpm требуется установленный rpm-4.4.2-47.el5.i386.rpm
  7. rpm-4.4.2-47.el5.i386.rpm
  8. m2crypto-0.16-6.el5.1.i386.rpm
  9. rpm-libs-4.4.2-47.el5.i386.rpm

Которые можно скачать с помощью любой доступной утилитой (fetch, ftp, wget, etc) с какого-либо зеркала официального репозитария CentOS.
К примеру, отсюда http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/

После того, как вы скачали все нужные пакеты, следует их установить.
Установка выполняется с помощью команды

[root@test tmp]# rpm -i

Устанавливаем в следующем порядке:

  1. m2crypto-0.16-6.el5.1.i386.rpm
  2. python-urlgrabber-3.1.0-2.noarch.rpm
  3. python-elementtree-1.2.6-5.i386.rpm
  4. python-sqlite-1.1.7-1.2.1.i386.rpm
  5. yum-metadata-parser-1.0-8.fc6.i386.rpm
  6. rpm-libs-4.4.2-47.el5.i386.rpm
  7. rpm-4.4.2-47.el5.i386.rpm
  8. rpm-python-4.4.2-47.el5.i386.rpm
  9. yum-3.0.5-1.el5.centos.5.noarch.rpm

Пакеты под номерами 6 и 7 устанавливаются немного хитрее. Используйте следующую команду:

[root@test tmp]# rpm -U rpm-libs-4.4.2-47.el5.i386.rpm rpm-4.4.2-47.el5.i386.rpm

Теперь обновляем пакеты дистрибутива командой

[root@test tmp]# yum update

Если да, то вручаю вам небольшой бонус. Скрипт, который делает все вышеперечисленное в автоматическом режиме 😉

== yum_install.sh ==
#/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH

mkdir /tmp/rpm
cd /tmp/rpm

wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/yum-3.0.5-1.el5.centos.5.noarch.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/yum-metadata-parser-1.0-8.fc6.i386.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/python-urlgrabber-3.1.0-2.noarch.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/rpm-python-4.4.2-47.el5.i386.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/rpm-4.4.2-47.el5.i386.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/m2crypto-0.16-6.el5.1.i386.rpm
wget http://centos.mirrors.skynet.be/pub/centos/5/os/i386/CentOS/rpm-libs-4.4.2-47.el5.i386.rpm

rpm -i m2crypto-0.16-6.el5.1.i386.rpm
rpm -i python-urlgrabber-3.1.0-2.noarch.rpm
rpm -i python-elementtree-1.2.6-5.i386.rpm
rpm -i python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -i yum-metadata-parser-1.0-8.fc6.i386.rpm
rpm -U rpm-libs-4.4.2-47.el5.i386.rpm rpm-4.4.2-47.el5.i386.rpm
rpm -i rpm-python-4.4.2-47.el5.i386.rpm
rpm -i yum-3.0.5-1.el5.centos.5.noarch.rpm

yum update -y
== yum_install.sh ==

Источник

Оцените статью
Adblock
detector