How to enable beta/unstable software libraries in Debian

Source: Internet
Author: User

How to enable beta/unstable software libraries in Debian
Why do I need to enable beta/unstable versions?

The beta/unstable version of Debian provides developers with an environment and software newer than the current stable version. Have you noticed this? In fact, these stable and unstable versions are all aliases. For example, stable versions are actually stable releases of Debian, the beta version will be the stable release of the next Debian version (of course it is after the test ). As of press time, the current stable release version of Debian is Wheezy 7.x. it will become the next stable version of the test version, which is Jessie.

When you need the latest version of an application, enabling the beta/unstable version will be the best choice. I had to install Apache 2.4.x to my Debian Wheezy for work purposes. The test version requires 2.4.x, but only 2.2.x is in my software library. So the best solution was to release the beta version.

Generally, when we want to try the latest version of the application, we should only search for it in the beta software library.

Debian 7.0 Wheezy test experience

Debian 7.0 Wheezy released!

Debian7 (Wheezy) and basic configuration for hard disk installation

In this article, I will teach you how to set up a test and unstable version of Debain without damaging your system and install software on it.

 
 
  1. Stable <Testing <Unstable (Stable <test version <Unstable Version)
  2. Wheezy <Jessie <Sid
1. Set the apt source for the test/unstable version.

The first step is to add the source of the test/unstable version to your sources. list file. On the Debian Wheezy system,/etc/apt/sources. list should look like this:

  1. $ Cat/etc/apt/sources. list
  1. ...
  2. Deb http://security.debian.org/wheezy/updates main
  3. Deb http://http.us.debian.org/debian/ wheezy main
  4. Deb-src http://security.debian.org/wheezy/updates main
  5. ...

Write down the link to your repo server, such as: http://http.us.debian.org/debian/

This repo server will be the closest server to you; there will be different URLs in different geographic locations, which will be used for the next step.

If you want to add a test/unstable source, add these items to the sources. list file:

  1. # Testing repository-main, contrib and non-free branches
  2. Deb http://http.us.debian.org/debian testing main non-free contrib
  3. Deb-src http://http.us.debian.org/debian testing main non-free contrib
  4. # Testing security updates repository
  5. Deb http://security.debian.org/testing/updates main contrib non-free
  6. Deb-src http://security.debian.org/testing/updates main contrib non-free
  7. # Unstable repo main, contrib and non-free branches, no security updates here
  8. Deb http://http.us.debian.org/debian unstable main non-free contrib
  9. Deb-src http://http.us.debian.org/debian unstable main non-free contrib

The format will be

  1. Deb <respository server/mirror> <repository name> <sub branches of the repo>
  2. (Deb <server or image url obtained in the previous step> <repo Name> <branch under repo>)

Of course, apart from using such bad words as testing or unstable, they can also use their release code, such as Jessie or Sid.

  1. Deb http://http.us.debian.org/debian jessie main non-free contrib
  2. Deb http://security.debian.org/jessie/updates main contrib non-free
  3. Deb http://http.us.debian.org/debian sid main non-free contrib
2. Pin apt! This is very important

After a test/unstable repo is added, When you update the system, all installed and available software will be updated immediately, and then your system will be self-defeating.

Therefore, you need to set some rules so that the selected software package will not be updated to an unstable test version during normal updates.

We need to use the "pin APT" method to tell the apt system that, in addition to the specific software packages we want to use the Beta or unstable version, other software packages are always updated using the stable version.

You can use one of the following two files to set the APT priority to "pin ".

  1. /Etc/apt/preferences
  2. Or
  3. /Etc/apt/preferences. d/my_preferences

Open one of the two files (if not, create one) and enter the following content:

  1. Package :*
  2. Pin: release a = stable
  3. Pin-Priority: 700
  4. Package :*
  5. Pin: release a = testing
  6. Pin-Priority: 650
  7. Package :*
  8. Pin: release a = unstable
  9. Pin-Priority: 600

As mentioned above, the stable version refers to your current debian version. The test version is the next version, while the unstable version is a further release version. In the above settings, the most important is the Priority (Pin-Priority ). The current stable version should have the highest priority. That is to say, normal apt-get operations will only install the software from the current stable version of the software library (now it is wheezy.

Update package cache

After a new software library and a priority rule are added, update the package cache.

  1. $ Sudo apt-get update
Confirm APT rules

We must confirm that the "dingtalk" setting is correct and the priority is correct. Use the policy parameter of apt-cache to check:

  1. $ Apt-cache policy apache2
  2. Apache2:
  3. Installed :( none)
  4. Candidate: 2.2.22-13
  5. Version table:
  6. 2.4.7-10
  7. 600 http://http.us.debian.org/debian/ unstable/main amd64 Packages
  8. 2.4.6-30
  9. 650 http://http.us.debian.org/debian/ testing/main amd64 Packages
  10. 2.2.22-130
  11. 700 http://http.us.debian.org/debian/ wheezy/main amd64 Packages

The above output confirms that in the stable version of wheezy, Apache of version 2.2.22 is the selected version, which has the highest priority.

3. Install software from the beta/unstable version of the software library

Now you can select a specific software from the Beta or unstable version to install it. Suppose we want to install apache2 from the beta software source.

There are two different methods and their results are different.

Method 1
  1. # Apt-get install apache2/testing

The above command will install apache2 from the beta software library, and install its dependent package from the stable software library (the stable version is determined by the apt rules ). This command may fail in some cases. For example, the dependent packages required for the installed software package (apache2) are not updated to support the software in the stable software library.

Method 2
  1. # Apt-get-t testing install apache2

The above command will install apache2 from the beta software library and install its dependent package from the beta software library. This is better than the above command.

Therefore, to install a newer software package, install it directly from the software library of the Beta/unstable version. Note that a priority number is not only a number, but also has a specific meaning. You can view the man page of apt_preferences to learn more:

  1. $ Man 5 apt_preferences
Summary

Using the "dingtalk" Method for Testing/unstable versions of the software library is a good way to get a newer version of the software package, but they are not recommended. If you make a mistake, the software package may be downloaded from a branch that may be incompatible, which will mess up your system.

A better way is to install the updated package using the backward ported software library. It obtains a newer version of the software package from the beta and unstable versions, but compiles the software package for the current stable version. Therefore, for debian wheezy, you can use the wheezy-backports software library. Visit http://backports.debian.org/learn more.

Resources
  • Https://wiki.debian.org/AptPreferences
  • Https://wiki.debian.org/DebianTesting
  • Https://www.debian.org/security/

Via: http://www.binarytides.com/enable-testing-repo-debian/

Translator: 213edu wxy Proofreader: wxy

This article was originally translated by LCTT and launched with the Linux honor in China

This article permanently updates the link address:

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.