Cainiao diary: several days after Debian is installed

Source: Internet
Author: User
Cainiao diary: a few days after Debian is installed-the Linux Release Technology-Debian information. For more information, see below. Author: beloved0214

Update System on the first day

Configure/etc/apt/sources. list

(1) first install apt-spy
# Apt-get install apt-spy

(2) Use apt-spy to test the Asian server and automatically save the fastest server to sources. list.
# Apt-spy-d testing-a Asia
Or: # apt-spy-d stable-a Asia-t 5
Note: The command line is running.
-D option specifies the release version, such as stable, testing, and unstable. Stable is a stable version. unstable has many new lab features, but this version is also unstable. testing depends on the two.
-Option a specifies the region where the debian source server is installed, such as Asia, Europe, and North-America. These region information is stored in the/etc/apt-spy.conf document, and if you want to test ALL servers, you can also replace the specific region with the ALL button.
The-t option specifies the connection timeout threshold. The threshold value is in seconds. Setting a smaller threshold can effectively increase the test speed and ignore slow servers.
After the apt-spy test is complete and the source address is updated, you can use apt-get update to update the source.
Apt-spy will automatically update your sources. list file. Apt-spy will back up the sources. list file before updating your sources. list, and copy the original sources. list to sources. list. bak. But every time you run the apt-spy command, it will generate a new sources. list. bak file to overwrite the old sources. list. bak. Therefore, we recommend that you back up the original sources. list file before using the apt-spy command.

Reinstall X-Window the next day

1. reinstall kde and gnome

1> install x-window
# Apt-get install x-window-system (or install the core # apt-get install x-window-system-core)
2> install gnome on the desktop
# Apt-get install gnome (or install the core # apt-get install gnome-core)
3> install the desktop environment kde
# Apt-get install kde (or install the core # apt-get install kde-core)
Note: You can use one of the preceding three commands.
# Apt-get install x-window-system gnome-core kde-core

2. Completely Delete kde and gnome

1> completely delete gnome
# Apt-get -- purge remove liborbit2
2> Delete kde
# Apt-get -- purge remove libqt3c102-mt

3. the logon result is "cocould not start kstartupconfig. Check your instalation.

Solution:
# Userdel-r chandroid
-R: Delete the User Directories together.
Then create a new user.
# Useradd-m chandroid
-M reate home directory for the new user account

Install JDK and elasticsearch on the third day

1. Install sun's jdk

1) Add the source image to the/etc/apt/sources. list file:
Deb http://www.backports.org/debian etch-backports main non-free

2) use apt-get update to update the source, and then:

# Apt-get install sun-java6-jdk
You can automatically install jdk.

3) Configure Environment Variables

1> change/etc/environment
CLASSPATH =/usr/lib/jvm/java-6-sun/lib
JAVA_HOME =/usr/lib/jvm/java-6-sun
JAVA_BIN =/usr/lib/jvm/java-6-sun/bin

2> modify the/etc/profile file
This method is recommended if your computer is used only for development, because all users' shells have the right to use these environment variables, which may bring security issues to the system.

Open/etc/profile in a text editor
Add the following content to the end of the profile file:
JAVA_HOME =/usr/lib/jvm/java-6-sun
PATH = $ JAVA_HOME/bin: $ PATH
CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME
Export PATH
Export CLASSPATH
Log on again
Annotation
A. Change/usr/lib/jvm/java-6-sun to your jdk installation directory.
B. Use the colon ":" To separate paths in linux
C. $ PATH/$ CLASSPATH/$ JAVA_HOME is used to reference the value of the original environment variable.
When setting environment variables, pay special attention not to overwrite the original values. This is a common error.
D. The current directory "." In CLASSPATH cannot be lost. It is also a common error to discard the current directory.
E. export exports the three variables as global variables.
F. Case sensitivity is required.

3> modify the. bashrc File
This method is more secure. It can control the permissions to use these environment variables to the user level. If you need to grant a user permission to use these environment variables, you only need to modify. you can use the bashrc file.

Open the. bashrc file in the user directory in a text editor.
Add the following content to the end of the. bashrc file:
Set JAVA_HOME =/usr/lib/jvm/java-6-sun
Export JAVA_HOME
Set PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
Set CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export CLASSPATH
Log on again

4> directly set variables in shell
I am not in favor of using this method. If you change the shell, your settings will be invalid. Therefore, this method is only for temporary use and will be re-set later, which is troublesome.
Run the following command on the shell terminal:
Export JAVA_HOME =/usr/lib/jvm/java-6-sun
Export PATH = $ JAVA_HOME/bin: $ PATH
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

5> test jdk
A. Create a Test. java file in the text editor, enter the following code and save it:
Public class hello {
Public static void main (String args []) {
System. out. println ("hello java word! ");
}
}
B. Compile: Execute the javac hello. java command on the shell terminal.
C. Run: run the java hello command on the shell terminal.
When "hello java word!" appears in shell !" Jdk runs normally.

2. Install ES (relatively simple)
# Apt-get install elasticsearch
Related Article

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.