) Build a C/C ++ environment in Ubuntu

Source: Internet
Author: User
Tags automake

I use the Ubuntu server version, which is easy to install and very simple. However, after installation, the operating system is almost a blank operating system with almost no content, so you have to install it.

Because it is dapper (6.06), I use the following method to replace the software source:

Vim/etc/APT/sources. List

Replace all content in the file with the following:

Http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
Deb http://archive.ubuntu.com/ubuntu/ dapper-security main restricted universe multiverse
Dapper-Updates main restricted universe multiverse
Dapper-backports main restricted universe multiverse
Http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse

here you can also directly use the faster ubuntu.cn99.com source (recommended ):
Deb http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu/ dapper-Updates main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu/ dapper -backports main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse

here you can also use the extremely fast ingress .lupaworld.com Source:
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper-security main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper-Updates main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper -backports main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ dapper main restricted universe multiverse

If the source of Shanghai Jiao Tong University is recommended for CERNET users:
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper main multiverse restricted universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-backports main multiverse extends universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-proposed main multiverse extends universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ -Security main multiverse restricted universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-Updates main multiverse restricted universe
Deb http://ftp.sjtu.edu.cn/ubuntu-cn/ dapper bleeding main multiverse restricted universe

CERNET users are also recommended to use the source of the Tsinghua University computer department student association:
Deb http://mirror.net9.org/ubuntu/ dapper main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-backports main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-proposed main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-security main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-Updates main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu-cn/ dapper main multiverse restricted universe

Save the edited File
Sudo apt-Get update

The root of the newly installed system cannot be entered. You need to change the password:
Sudo passwd Root

It is used on the Intranet, so root is used directly. sudo is too troublesome!

Next, install SSH for remote login:
Apt-Get Install SSH

OK, then install the compiler:

Apt-Get install gcc
Apt-Get install make
Apt-Get install Autoconf
Apt-Get install automake
Apt-Get install libtool
Apt-Get install GDB
Apt-Get install g ++

Editor. I prefer vim and installed it.
Apt-Get install Vim
By default, VIM has no syntax coloring,
Modify/etc/Vim/vimrc
You just need to remove the comments of syntax on.

To make Vim easy to use, you also need to install some necessary plug-ins. Here I reference twoArticle:

The first section describes some basic Vim skills. Mastering these skills can greatly improve the editing efficiency, but the powerful functions of Vim are not limited to this. Vim can also use plug-ins to Expand functions. Specifically, scripts are extended through scripts, including plug-ins, syntax highlighting, color schemes, and file type detection. Most of the scripts are written by VIM users, which solves user problems and makes Vim more useful. This chapter describes some of the most commonly used scripts, except for a "highlighted Syntax" script, which belongs to the "plug-in" type. Some basic knowledge about how to write scripts will be introduced in the next section.

I use the Ubuntu server version, which is easy to install and very simple. However, after installation, the operating system is almost a blank operating system with almost no content, so you have to install it.

Because it is dapper (6.06), I use the following method to replace the software source:

Vim/etc/APT/sources. List

Replace all content in the file with the following:

Http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
Deb http://archive.ubuntu.com/ubuntu/ dapper-security main restricted universe multiverse
Dapper-Updates main restricted universe multiverse
Dapper-backports main restricted universe multiverse
Http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse

Here you can also directly use the faster ubuntu.cn99.com source (recommended ):
Http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
Dapper-Updates main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe multiverse
Dapper-backports main restricted universe multiverse
Http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse

here you can also use the extremely fast ingress .lupaworld.com Source:
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper-security main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper-Updates main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/archive/ dapper -backports main restricted universe multiverse
Deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ dapper main restricted universe multiverse

If the source of Shanghai Jiao Tong University is recommended for CERNET users:
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper main multiverse restricted universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-backports main multiverse extends universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-proposed main multiverse extends universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ -Security main multiverse restricted universe
Deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-Updates main multiverse restricted universe
Deb http://ftp.sjtu.edu.cn/ubuntu-cn/ dapper bleeding main multiverse restricted universe

CERNET users are also recommended to use the source of the Tsinghua University computer department student association:
Deb http://mirror.net9.org/ubuntu/ dapper main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-backports main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-proposed main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-security main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu/ dapper-Updates main multiverse restricted universe
Deb http://mirror.net9.org/ubuntu-cn/ dapper main multiverse restricted universe

Save the edited File
Sudo apt-Get update

The root of the newly installed system cannot be entered. You need to change the password:
Sudo passwd Root

It is used on the Intranet, so root is used directly. sudo is too troublesome!

Next, install SSH for remote login:
Apt-Get Install SSH

OK, then install the compiler:

Apt-Get install gcc
Apt-Get install make
Apt-Get install Autoconf
Apt-Get install automake
Apt-Get install libtool
Apt-Get install GDB
Apt-Get install g ++

Editor. I prefer vim and installed it.
Apt-Get install Vim
By default, VIM has no syntax coloring,
Modify/etc/Vim/vimrc
You just need to remove the comments of syntax on.

To make Vim easy to use, you also need to install some necessary plug-ins. Here I reference two articles:

The first section describes some basic Vim skills. Mastering these skills can greatly improve the editing efficiency, but the powerful functions of Vim are not limited to this. Vim can also use plug-ins to Expand functions. Specifically, scripts are extended through scripts, including plug-ins, syntax highlighting, color schemes, and file type detection. Most of the scripts are written by VIM users, which solves user problems and makes Vim more useful. This chapter describes some of the most commonly used scripts, except for a "highlighted Syntax" script, which belongs to the "plug-in" type. Some basic knowledge about how to write scripts will be introduced in the next section.

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.