Tip: Upgrade the application from the source code

Source: Internet
Author: User
Article Title: tip: Upgrade the application from the source code. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
   Upgrade can also be simple
Upgrading the software from the source code can also be easy, but you should take several preventive measures. When you are new to compiling the source code or are not familiar with the source code file to be installed, pay special attention to it. The following lists the points that you should pay close attention to, but in most cases, the upgrade is almost the same as the initial compilation and installation steps. That is to say, these steps include opening the tar package, optional "./configure", "make", and "make install ". If you are not familiar with these terms, first check the Compilingand installing software from sources tutorial on developerWorks, and then read back this article.
  
   Read Changelog
After downloading the source code, familiarize yourself with the new software changes, which are usually listed in the ChangeLog or README file of the source code home directory. You may find that the configuration file settings are slightly changed, or you have added some new features. It is best to find out these changes in the source code document, instead of waiting until errors are made in these places before remediation. It is absolutely wrong to skip this step. In addition, since you have spent time installing the new version of the software package, it is not a good thing to know what new features it includes or what errors it fixes?
  
   Upgrade key applications
If you are upgrading applications that affect many users (such as Apache on busy Web servers), it is worth noting. If possible, first install the source code of the new version on a non-production machine, and write down every step to start and run the new version. In this way, even if you encounter problems during the upgrade process, it will not cause any harm. In addition, when you are about to upgrade your production machine, you already have a detailed list of the steps you want to perform-which can shorten the high-cost downtime.
  
In addition, if you are upgrading key applications, upgrading during off-peak hours is always the best option.
  
   Configure in the same way
One of the major mistakes that people are prone to make when upgrading applications is ". the/configure row specifies different incompatible options, or the comment mark of different rows is removed in the Makefile configuration. If you want to perform a simple upgrade, make sure that the configuration of the new software version is the same as that of the current version.
  
If the current version finds its configuration file under the/etc directory, it is better to configure the new version in the same way. Do not rashly do it; if you are in ". the/configure command line passes different options. The result is that the new version has obviously different functions and is installed in the wrong directory tree, or find its configuration file or data file in the wrong location. If you forget the original configuration options or Makefile definition, you must check before compiling and installing the new version. To make the upgrade smooth, you will want to get these settings from the very beginning.
  
   Back up the original configuration file before installing
For many packages, the real challenge is not in the compilation and installation phase, but in the process of setting up the application after you type "make install. This usually takes several hours to edit the application configuration file. The configuration file is usually in the/etc directory and has a common suffix ". conf.
  
When you type "make install" to install the new version of the package, most makefiles do not overwrite the existing configuration files on the disk-but if you consider security, we should be thankful for this, rather than expressing regret for it. If you are not sure, you must back up the previous configuration file! Some configuration files may take several days to re-build, which varies with the packages. If the configuration file contains an encrypted password, re-building is quite time-consuming or simply impossible.
  
If you are planning a major upgrade to your Linux system, it may be a good time to back up the entire system. This is especially important if you are preparing to upgrade a key system library or tool that serves as the basis for the normal operation of many packages. Full system backup is a good idea. I hope you will back up the system from time to time.
  
   Prepare older source code
I have no intention of dissuade you from upgrading your favorite program to the latest version-but the new version may not work. "./Configure" or "make" may crash. Even worse, every step, including "make install", passes smoothly until the program runs. The source code release of the Multi-worm does exist. That is why it is a good idea to keep the older source code (and any installation steps) at hand, in case the newer source code is abnormal.
  
   Test!
Compiling and installation are one thing, and it is completely another thing to be sure that the new software works normally. Make sure that you have not Installed 500 KB of garbage in the root partition. The configuration file of the new version may need to be modified a little or even significantly. If you are upgrading the daemon, make sure that the new version is successfully started by your configuration script when you restart the system. You do not want to find any problems when you restart the server two weeks later (and you have forgotten the configuration details of the program. You can follow the suggestions in this article, but if you do not test your installation, you are missing the most important step.

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.