yum – Internetblog.org.uk https://www.internetblog.org.uk Web hosting, Domain names, Dedicated servers Fri, 29 Jan 2016 11:05:52 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 https://www.internetblog.org.uk/files/2016/01/cropped-favico-32x32.png yum – Internetblog.org.uk https://www.internetblog.org.uk 32 32 How to Force YUM to Exclude Certain Packages https://www.internetblog.org.uk/post/1546/how-to-force-yum-to-exclude-certain-packages-2/ Mon, 19 Jul 2010 18:13:41 +0000 http://www.internetblog.org.uk/post/1546/how-to-force-yum-to-exclude-certain-packages-2/ YUM logoYUM is a package management system for Red Hat Enterprise Linux (RHEL), CentOS, Fedora, and other Red Hat-based Linux operating systems. It is command-line driven and is an easy tool you can use to keep your server updated and install any new software you need.

Normally, when you perform updates, YUM will search the distribution’s online repository and select any newly updated packages for download and installation. These may include everything from Apache web server to the Linux kernel itself.

Most of the time, it is a general good practice to update all of the available packages, but there are times when this may not be ideal. For example, if you know for certain that a new version of a particular package that you have installed will not work with a version of one of your web applications, you may want to delay updating until you have patched your application. Another possible scenario is that you may want to update most of your other packages now but wait until later to update the kernel, which will require a reboot.

YUM has a built-in feature that allows you to exclude a package or group of packages of your choosing. You can either use the exclude function on a long-term basis or for one particular update. To make a long-term change, you should edit your repository file (usually yum.conf). Find the [main] section and add the following line:

exclude=package1* package2 package3*

A name by itself will exclude only that package. The “*” after some names will exclude any packages with those words in it.

To exclude specific packages for a single update, you can use the exclude flag from the command line:

yum --exclude=packagename* update

If you later decide to proceed with updating that package, just run update without the exclude flag.

]]>
How to Remove Software in Linux https://www.internetblog.org.uk/post/1531/how-to-remove-software-in-linux/ Wed, 14 Jul 2010 19:22:06 +0000 http://www.internetblog.org.uk/post/1531/how-to-remove-software-in-linux/ Delete icon
Question: How do I remote software that I installed from my Linux dedicated server?

Answer: The answer to that question depends on how you installed the software in the first place. Once you establish how and where the software has been installed, you can determine how to remove it.

1. Package Manager – Most software should be installed with a package manager like YUM or Apt. If that is the case, you remove it with the normal command for the package manager:

yum remove [packagename] apt-get remove [packagename]

2. Manual Deb, RPM, etc – If you installed a distribution package manually, you can remove it manually or use your package manager to remove it.

3. Binary Archive – If you were given a tar.gz or similar package with binaries inside, and you unpacked them to a directory, simply remove the directory. If the package had an installer program, try using that to uninstall it.

4. Source – If you compiled the software from source and used “make install” to install it, removing it may be more tricky. If you still have the source files, you can simply run “make uninstall”. Otherwise, you will have to find out where the files were installed and remove. They may be in several directories.

]]>
What is a Linux Package? https://www.internetblog.org.uk/post/1520/what-is-a-linux-package/ Mon, 12 Jul 2010 19:13:06 +0000 http://www.internetblog.org.uk/post/1520/what-is-a-linux-package/
linux packageQuestion
: I have a new Linux dedicated server, and I have read a lot of documentation referring to packages. What are Linux packages?

Answer: In Linux distributions, a “package” refers to a compressed file archive containing all of the files that come with a particular application. The files are usually stored in the package according to their relative installation paths on your system. Most packages also contain installation instructions for the OS, as well as a list of any other packages that are dependencies (prerequisites required for installation.

Common types of Linux packages include .deb, .rpm, and .tgz. Since Linux packages do not usually contain the dependencies necessary to install them, many Linux distributions use package managers that automatically read dependencies files and download the packages needed before proceeding with the installation. Some examples of package managers are APT, YUM, and Pacman.

]]>
Useful RPM Tips https://www.internetblog.org.uk/post/1366/useful-rpm-tips/ Thu, 27 May 2010 17:07:05 +0000 http://www.internetblog.org.uk/post/1365/useful-rpm-tips/ RPM logoAs I mentioned in an earlier post, YUM is a powerful package management system, commonly used in RPM-based Linux distributions, including Red Hat Enterprise Linux, CentOS, and Fedora. We have covered some of the basic YUM commands. Now, here are some helpful commands not in YUM that you can use to better manage your RPM packages.

1. Reset file permissions – This is for those times when you have made changes to an application that you probably should not have made. RPM can reset the permissions for all files in the package and return them to the state they were in when you installed it. Simply run this command:

rpm --setperms

2. Extract one file from an rpm – Whenever you do not actually want to install an RPM, you can extract its contents. This is also useful if you have changed something in one of the files and just need to extract the default file, like logrotate.conf. Run this command:

rpm2cpio logrotate-1.0-1.i386.rpm |cpio -ivd etc/logrotate.conf

3. Query 3rd party packages – In this example, suppose you are using CentOS, but you want to query packages from other repositories. This command will allow you to find packages not in the CentOS repository.

rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v CentOS

]]>
Software That Requires Perl Modules https://www.internetblog.org.uk/post/1358/software-that-requires-perl-modules/ Mon, 24 May 2010 16:22:02 +0000 http://www.internetblog.org.uk/post/1358/software-that-requires-perl-modules/ Perl camel logoWhen you install perl applications on a server, they will invariably require you to install additional modules for support. This is part of the unfortunate reality of running perl applications. Typically, the required module names will be displayed like this, Date::Format or File::Tail.

If you have ever tried to find the modules in your YUM or APT repositories, you probably had difficulty. That is because the naming scheme is different in Linux package management. For example, in most APT repositories, Date::Format is found in the package, libtimedate-perl, which also includes Date::Parse and some others. When you search for packages, just search for the keywords “date” and “format”, leaving off the “::”.

If you are sure the modules are not found in your package repository, you will have to install them manually. CPAN (Comprehensive Perl Archive Network) is a program that takes some of the pain out of installing perl modules, but it is still not a particularly enjoyable adventure. For more information about installing modules with CPAN, see this tutorial.

Photo Source: Wikimedia Commons

]]>
Linux server dependencies https://www.internetblog.org.uk/post/1098/linux-server-dependencies/ Tue, 16 Mar 2010 13:48:27 +0000 http://www.internetblog.org.uk/post/1098/linux-server-dependencies/
Question: What are dependencies in Linux and how do I manage them?

Answer: In any operating system, an program requires other programs, drivers, and libraries of files to run. The program depends on those files, so they are called dependencies. Many commercial vendors will packages the dependencies in the installation files of the software, but this can create duplicates and also leave behind unnecessary clutter when the program is uninstalled.

The Linux method of dealing with dependencies is to let the system administrator decide how to handle them. Therefore, if you try to install a single Linux package, either from source or binary, it will require certain other packages to be already installed and configured. If they are not, the program will not be able to run and usually will not even install.

Package managers such as YUM and APT are therefore critical in a production server environment. These systems automatically find necessary dependencies for packages and install them before installing the package. As a result, your programs install and work immediately without any user intervention.

Photo Source: Flickr

]]>
How to upgrade CentOS https://www.internetblog.org.uk/post/1055/how-to-upgrade-centos/ Wed, 03 Mar 2010 18:03:24 +0000 http://www.internetblog.org.uk/post/1055/how-to-upgrade-centos/ YUM update CentOS
Question: How do I upgrade my CentOS installation to a higher version?

Answer: Using YUM you can upgrade CentOS with only a few steps.

1. Backup your important data. If most or all of is in a database, make sure to backup all databases.

2. List all of the updates:

# yum list updates

3. Upgrade your distribution:

# yum update

4. Reboot the server:

# reboot

5. Verify that all systems are working:

# uname -a
# netstat -tulpn
# tail -f /var/log/messages
# tail -f /path/to/log/file
# cat /etc/redhat-release

Note: Because the kernel will be upgraded, you will need to reboot the server after completion, so you should plan a scheduled down time when your website(s) will have the least amount of activity.

Source: nixCraft

]]>
How to install OpenVZ with yum https://www.internetblog.org.uk/post/1036/how-to-install-openvz-with-yum/ Thu, 25 Feb 2010 20:18:37 +0000 http://www.internetblog.org.uk/post/1036/how-to-install-openvz-with-yum/ OpenVZ logoOpenVZ is a free and open source virtualization solution for Linux. Here is an easy guide to installing OpenVZ on Redhat Enterprise Linux, CentOS, or Fedora.

Note: It is recommended that you use an ext2 or ext3 file system if you want per-container disk quota.

1. Add the OpenVZ YUM repository:

# cd /etc/yum.repos.d
# wget http://download.openvz.org/openvz.repo
# rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

2. Find out which kernel version you need and install it:

# yum install ovzkernel[-flavor]

3. Change the new GRUB bootloader lines created when you installed the kernel to look something like this in /boot/grub/grub.conf:

title OpenVZ (2.6.8-022stab029.1)
root (hd0,0)
kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5
initrd /initrd-2.6.8-022stab029.1.img

That’s it! You now have OpenVZ installed. Visit the OpenVZ wiki for more information about configuring your new installation.

Source: OpenVZ Quick Installation

]]>
How to install Nginx via YUM in CentOS https://www.internetblog.org.uk/post/1027/how-to-install-nginx-via-yum-in-centos/ Tue, 23 Feb 2010 19:48:29 +0000 http://www.internetblog.org.uk/post/1027/how-to-install-nginx-via-yum-in-centos/ nginx logoNginx (pronounced “Engine X”) is a lightweight web server that offers speed and flexibility without all of the extra features that larger web servers like Apache offer. Although it is a free and open source application, CentOS does not offer the latest version in its default YUM repository. To install it, you need to add the EPEL (Extra Packages for Enterprise Linux) repository, which is part of the Fedora Project.

1. Install the EPEL repository:

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm

2. Install nginx

# yum install nginx

3. You will be asked to install the gpg-key for EPEL. Answer yes

4. Start Nginx

# /etc/init.d/nginx start

5. Check the installation by going to your web server’s default site, either using your ip address or domain name.

]]>
How to force YUM to exclude certain packages https://www.internetblog.org.uk/post/858/how-to-force-yum-to-exclude-certain-packages/ Thu, 07 Jan 2010 20:27:07 +0000 http://www.internetblog.org.uk/post/858/how-to-force-yum-to-exclude-certain-packages/ YUM logoQuestion: Is there a way to tell YUM to ignore certain packages when performing updates on a CentOS Linux server?

Answer: There certainly is, and in some cases it can save your server from an unfortunate mishap. When running a dedicated server, particularly one with multiple websites, you run the risk of alienating a particular site or site application by updating key services without first testing them.

For example, the Linux kernel, PHP, and even Apache release new versions on a regular basis, but sometimes a new version might break currently installed scripts or applications. By excluding those or other packages from updates, you can ensure that you have time to notify users and clients and prepare updates of any scripts.

To use the exclude function, edit your yum.conf file:

Under the [main] section, add the following line:

exclude=php* kernel*

This would exclude any package with the words “php” or “kernel”. You can list any packages there. If you only want to exclude a package from a specific update instance, you can exclude it directly from the command line:

# yum --exclude=packagename* update

]]>