Why can you install the same package by different names with Yum - apache

On Centos 6 I can do
# yum install webserver
or
# yum install httpd
And both commands will install httpd (apache)
I am building an RPM and I don't know which one I should use or why they are different.
Do packages have a 'generic' name that you can address them by? For instance if you had lighttpd installed it could provide the webserver package?

An RPM provides many things. Be they native library references, perl modules, etc. All are calculated while the RPM is built.
But you can also provide things yourself in a spec file (the file used to build an RPM), as in:
Provides: blablabla
So, it means the httpd package has:
Provides: webserver
in its spec file.
You can query what an installed package provides with:
rpm -q --provides pkgnamehere
But you can also ask what package provides something:
rpm -q --whatprovides theprovidedname
Finally, you can ask yum about provides:
yum whatprovides webserver
yum whatprovides grep
yum whatprovides /usr/bin/find
# etc etc

Related

Adding Qt Dependencies to spec file in rpmbuild

I'm using Ubuntu 14.04 and I am updating the rpmbuild spec file of an application that now uses Qt.
The packages that I need are the following:
sudo apt-get build-essential
sudo apt-get install mesa-common-dev -y
sudo apt-get install libglu1-mesa-dev -y
sudo apt-get qt5-default
sudo apt-get qtwebengine5-dev
I know the spec file has "BuildRequires" and "Requires" dependency tags...any help in writing this as well as some examples would be helpful. I have a working spec file I just need to add the dependencies.
I think there is some confusion here. spec files are used to generate rpm files. However Ubuntu uses deb files.
Supposing you really want to create an rpm; then you need to know this:
BuildRequires
these packages are required for building the rpm. Typically you will need build-essential and the '*-dev` packages for building your application
Requires
these packages are required upon installation for your application to work; mostly you don't need your build-tools anymore, but you still need the qt5-default for example.
PS: on a little side note I might be one of the only people in the world building deb packages using spec files with a special conversion script https://bitbucket.org/klaussfreire/spec2deb/src/default/ but I wouldn't really recommend that.

Terminal command in fedora

What does the yum and -y means
yum install httpd -y
new to fedora. please guide me.
the above code will install Apache server in fedora
yum is a software package manager that installs, updates, and removes packages on RPM-based systems. It automatically computes dependencies and figures out what things should occur to install packages. yum makes it easier to maintain groups of machines without having to manually update each one using rpm.
-y means that we did't want to gave yes to install any package (here httpd)
httpd installs apache web server
Thanks for Support and advice

How install Intl, GMP and BCMath PHP extensions?

Centos 6.8 Final
Php 7.0.16
Directadmin control panel
yum install php-gmp
yum install php-bcmath
yum install php-intl
result is: No package xxx available.
Thank you.
BCmath is already preinstalled with PHP. http://php.net/manual/en/bc.requirements.php
For other libs try to define repository where yum would search artifacts and then install the extension. For example,
yum --enablerepo=remi install php-intl
Another alter way is described there https://webtatic.com/packages/php70/
Take a look at the php70w-common package which includes gmp, and further just install php70w-bcmath and php70w-intl. Don't forget to enable all packages inside php.ini.

how install pdo-mysql in centos7

I install laravel 5 and then install packages neede.
I install php-pdo and some other but now i cant install pdo-mysql and laravel return error.
PDOException in PDOConnection.php line 47: could not find driver
I am use Centos 7 and PHP 5-6-29.
Check which package is installed (which provider) and provides the stack, then use the same namespace.
Webtatic uses php56w-*
IUS uses php56u-*
remi-safe (SCL packages) use php56-php-*
remi-php56 simply use php-*
other providers can use something else
As you need pdo_mysql driver, simply
yum install <namespace>-pdo_mysql
(using the ext name, yum will find the correct package name which provides this ext).
Also check you don't have any "exclude" lines in the yum configuration (such as the ones provided in altered cpanel distributions)
Try using this
yum install php-mysql
systemctl restart httpd
You can search package like
yum search php
Pick the ones you need and install them like this:
yum -y install php-mysqlnd php-pdo
In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, and Drupal:
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
https://webtatic.com/packages/php56/
I believe the driver is php56w-mysql so yum install php56w-mysql should do the job.

how to debug inconsistency between yum list on different machines

I have two different RHEL5.8 machines, which have exactly the same /etc/yum.repos.d/ and /etc/yum/. On one machine when I do yum search openssl-devel or yum search yum-utils I get a result, on the other I do not. I installed the repository that I have as follows:
rpm -Uhv http://redhat-clientconfig-us-east-1.s3.amazonaws.com/rh-amazon-rhui-client-2.2.16-1.el5.noarch.rpm
rpm -Uhv http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uhv http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm
I also cannot find any result for yum search httpd to install apache.
So, how can I resolve the yum inconsistency? And how do I install the latest httpd (say even without enabling RHN)?
You correctly discovered that the systems need to be registered with an RHN server for the yum searched to work. Otherwise, yum has no server or repository to search.