Install the software package from the apt source on a CD-Rom In debian

Source: Internet
Author: User
Install the software package from the apt source on a CD-Rom In debian-Debian, which is the Linux release technology. For details, refer to the following section. Here I will install gcc as an example.

1. Modify the source

Debian-dk :~ # Vim/etc/apt/sources. list
Deb cdrom: [Debian GNU/Linux 4.0 r0 _ Etch _-Official i386 CD Binary-1 20070407-]/etch contrib main

2. Install gcc

Debian-dk :~ # Apt-get install gcc
Reading the package list... complete
Analyzing the dependency tree of the software package... finished
The following additional software packages will be installed:
Libssp0 gcc-4.1
Recommended software packages:
Manpages-dev autoconf automake1.9 libtool flex bison gcc-doc gcc-4.1-doc
Gcc-4.1-locales libc6-dev-amd64 lib64gcclib64ssp0
Recommended software packages:
Libc6-dev libc-dev libmudflap0-dev
The following [new] software packages will be installed:
Gcc gcc-4.1 libssp0
A total of 0 software packages have been upgraded, 3 new software packages have been installed, 0 software packages have to be uninstalled, and 0 software have not been upgraded.
Download the 0B/470kB software package.
After decompression, the extra space of KB is consumed.
Do you want to continue? [Y/n] y
The software package libssp0 was deselected.
(Reading the database... the system currently has a total of 52968 files and directories installed .)
Extracting libssp0 (from.../libssp0_4.1.1-21_i386.deb )...
Selected the software package gcc-4.1 that was deselected.
Extracting the gcc-4.1 (from.../gcc-4.1_4.1.1-21_i386.deb )...
Select the software package gcc that has been deselected.
Extracting gcc (from.../gcc_4.1.1-15_i386.deb )...
Setting libssp0 (4.1.1-21 )...

Setting gcc-4.1 (4.1.1-21 )...
Setting gcc (4.1.1-15 )...

3. Check the gcc information to see if the gcc is installed.


Debian-dk :~ # Man gcc
No manual entry for gcc
See 'man 7 untitled ented' for help when manual pages are not available.
Debian-dk :~ # Ls
Debian-dk :~ # Find-name gcc
Debian-dk :~ # Gcc -- help
Usage: gcc [options] file...
Options:
-Pass-exit-codes Exit with highest error code from a phase
-- Help Display this information
-- Target-help Display target specific command line options
(Use '-v -- help' to display command line options of sub-processes)
-Dumpspecs Display all of the built in spec strings
-Dumpversion Display the version of the compiler
-Dumpmachine Display the compiler's target processor
-Print-search-dirs Display the directories in the compiler's search path
-Print-libgcc-file-name Display the name of the compiler's companion library
-Print-file-name = Display the full path to library
-Print-prog-name = Display the full path to compiler component
-Print-multi-directory Display the root directory for versions of libgcc
-Print-multi-lib Display the mapping between command line options and
Multiple library search directories
-Print-multi-OS-directory Display the relative path to OS libraries
-Wa, Pass comma-separated On to the worker er
-Wp, Pass comma-separated On to the preprocessor
-Wl, Pass comma-separated On to the linker
-Xforwarer Pass on to the specified er
-Xpreprocessor Pass on to the preprocessor
-Xlinker Pass on to the linker
-Combine Pass multiple source files to compiler at once
-Save-temps Do not delete intermediate files
-Pipe Use pipes rather than intermediate files
-Time Time the execution of each subprocess
-Specs = Override built-in specs with the contents
-Std = Assume that the input sources are
-- Sysroot = Use As the root directory for headers
For headers and libraries
-B Add To the compiler's search paths
-B Run gcc for target , If installed
-V Run gcc version number , If installed
-V Display the programs invoked by the compiler
-### Like-v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-C Compile and assemble, but do not link
-O Place the output
-X Specify the language of the following input files
Permissible versions ages include: c ++ aggreger none
'None' means revert to the default behavior
Guessing the language based on the file's extension

Options starting with-g,-f,-m,-O,-W, or -- param are automatically
Passed on to the various sub-processes invoked by gcc. In order to pass
Other options on to these processes the-W Options must be used.

For bug reporting instructions, please see:
.
For Debian GNU/Linux specific bug reporting instructions, please see:
.

4. OK. Write helloworld and try gcc.

Debian-dk :~ # Ls
Debian-dk :~ # Vim hello. c
Debian-dk :~ # Gcc-o hello. c
Hello. c: 1: 19: error: stdio. h: No file or directory
Hello. c: In function 'main ':
Hello. c: 4: warning: incompatible implicit declaration of built-in function 'printf'

The problem, can not find stdio. h, it is because no library installed, installed on the libc6-dev on the line, go down

5. Install the libc library

Debian-dk :~ # Apt-get install libc-dev
Reading the package list... complete
Analyzing the dependency tree of the software package... finished
Note that I chose libc6-dev instead of libc-dev
The following additional software packages will be installed:
Libc6-dev linux-kernel-headers
Recommended software packages:
Glibc-doc manpages-dev
The following [new] software packages will be installed:
Libc6-dev linux-kernel-headers
A total of 0 software packages have been upgraded, 2 new software packages have been installed, 0 software packages have to be uninstalled, and 0 software have not been upgraded.
Download the 0B/4591kB software package.
After decompression, 22.2 MB of extra space is consumed.
Do you want to continue? [Y/n] y
The linux-kernel-headers software package that was deselected was selected.
(Reading the database... the system currently has a total of 53056 files and directories installed .)
Extracting linux-kernel-headers (from.../linux-kernel-headers_2.6.18-7_i386.deb )...
Selected the software package libc6-dev that was deselected.
Extracting the libc6-dev (from.../libc6-dev_2.3.6.ds1-13_i386.deb )...
Setting linux-kernel-headers (2.6.18-7 )...
Setting libc6-dev (2.3.6.ds1-13 )...

6. OK is installed. Let's take a look at helloworld.

Debian-dk :~ # Gcc-o hello. c
Debian-dk :~ # Ls
Hello. c
Debian-dk :~ #./Hello
Hello debian world!

7, finished!
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.