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.
- Stable <Testing <Unstable (Stable <test version <Unstable Version)
- 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:
- $ Cat/etc/apt/sources. list
- Deb http://security.debian.org/wheezy/updates main
- Deb http://http.us.debian.org/debian/ wheezy main
- Deb-src http://security.debian.org/wheezy/updates main
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:
- # Testing repository-main, contrib and non-free branches
- Deb http://http.us.debian.org/debian testing main non-free contrib
- Deb-src http://http.us.debian.org/debian testing main non-free contrib
- # Testing security updates repository
- Deb http://security.debian.org/testing/updates main contrib non-free
- Deb-src http://security.debian.org/testing/updates main contrib non-free
- # Unstable repo main, contrib and non-free branches, no security updates here
- Deb http://http.us.debian.org/debian unstable main non-free contrib
- Deb-src http://http.us.debian.org/debian unstable main non-free contrib
The format will be
- Deb <respository server/mirror> <repository name> <sub branches of the repo>
- (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.
- Deb http://http.us.debian.org/debian jessie main non-free contrib
- Deb http://security.debian.org/jessie/updates main contrib non-free
- 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 ".
- /Etc/apt/preferences. d/my_preferences
Open one of the two files (if not, create one) and enter the following content:
- Package :*
- Pin: release a = stable
- Pin-Priority: 700
- Package :*
- Pin: release a = testing
- Pin-Priority: 650
- Package :*
- Pin: release a = unstable
- 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.
- $ 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:
- $ Apt-cache policy apache2
- Installed :( none)
- Candidate: 2.2.22-13
- Version table:
- 600 http://http.us.debian.org/debian/ unstable/main amd64 Packages
- 650 http://http.us.debian.org/debian/ testing/main amd64 Packages
- 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.
- # 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.
- # 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:
- $ Man 5 apt_preferences
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.
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: