热门标签 | HotTags
当前位置:  开发笔记 > 运维 > 正文

debian下以光盘为apt源安装软件包

debian下以光盘为apt源安装软件包--Linux发行版技术-Debian信息,下面是详情阅读。
这里我以安装gcc为例。

1,修改源

debian-dk:~# vim /etc/apt/sources.list
deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 CD Binary-1 20070407-11:55]/ etch contrib main

2,安装gcc

debian-dk:~# apt-get install gcc
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
将会安装下列额外的软件包:
gcc-4.1 libssp0
建议安装的软件包:
manpages-dev autoconf automake1.9 libtool flex bison gcc-doc gcc-4.1-doc
gcc-4.1-locales libc6-dev-amd64 lib64gcc1 lib64ssp0
推荐安装的软件包:
libc6-dev libc-dev libmudflap0-dev
下列【新】软件包将被安装:
gcc gcc-4.1 libssp0
共升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 0 个软件未被升级 。
需要下载 0B/470kB 的软件包。
解压缩后会消耗掉 1401kB 的额外空间。
您希望继续执行吗?[Y/n]y
选中了曾被取消选择的软件包 libssp0。
(正在读取数据库 ... 系统当前总共安装有 52968 个文件和目录。)
正在解压缩 libssp0 (从 .../libssp0_4.1.1-21_i386.deb) ...
选中了曾被取消选择的软件包 gcc-4.1。
正在解压缩 gcc-4.1 (从 .../gcc-4.1_4.1.1-21_i386.deb) ...
选中了曾被取消选择的软件包 gcc。
正在解压缩 gcc (从 .../gcc_4.1.1-15_i386.deb) ...
正在设置 libssp0 (4.1.1-21) ...

正在设置 gcc-4.1 (4.1.1-21) ...
正在设置 gcc (4.1.1-15) ...

3,查看gcc信息,看是否安装好


debian-dk:~# man gcc
No manual entry for gcc
See 'man 7 undocumented' 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 assembler
-Wp, Pass comma-separated on to the preprocessor
-Wl, Pass comma-separated on to the linker
-Xassembler Pass on to the assembler
-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 of
-std= Assume that the input sources are for
--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 into
-x Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
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:
http://gcc.gnu.org/bugs.html>.
For Debian GNU/Linux specific bug reporting instructions, please see:
.

4,ok,写个helloworld试试gcc

debian-dk:~# ls
debian-dk:~# vim hello.c
debian-dk:~# gcc -o hello hello.c
hello.c:1:19: error: stdio.h: 没有那个文件或目录
hello.c: In function ‘main’:
hello.c:4: warning: incompatible implicit declaration of built-in function ‘printf’

出问题了,找不到stdio.h,那是因为没装库,装上libc6-dev就行了,往下走

5,安装libc库

debian-dk:~# apt-get install libc-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
注意,我选了 libc6-dev 而非 libc-dev
将会安装下列额外的软件包:
libc6-dev linux-kernel-headers
建议安装的软件包:
glibc-doc manpages-dev
下列【新】软件包将被安装:
libc6-dev linux-kernel-headers
共升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
需要下载 0B/4591kB 的软件包。
解压缩后会消耗掉 22.2MB 的额外空间。
您希望继续执行吗?[Y/n]y
选中了曾被取消选择的软件包 linux-kernel-headers。
(正在读取数据库 ... 系统当前总共安装有 53056 个文件和目录。)
正在解压缩 linux-kernel-headers (从 .../linux-kernel-headers_2.6.18-7_i386.deb) ...
选中了曾被取消选择的软件包 libc6-dev。
正在解压缩 libc6-dev (从 .../libc6-dev_2.3.6.ds1-13_i386.deb) ...
正在设置 linux-kernel-headers (2.6.18-7) ...
正在设置 libc6-dev (2.3.6.ds1-13) ...

6,ok装好了,再来看看helloworld

debian-dk:~# gcc -o hello hello.c
debian-dk:~# ls
hello hello.c
debian-dk:~# ./hello
hello debian world!

7,finished!
推荐阅读
  • 本文介绍了如何在Ubuntu 16.04系统上配置Nginx服务器,以便能够通过网络访问存储在服务器上的图片资源。这解决了在网页开发中需要使用自定义在线图标的需求。 ... [详细]
  • 本文详细介绍了 Dockerfile 的编写方法及其在网络配置中的应用,涵盖基础指令、镜像构建与发布流程,并深入探讨了 Docker 的默认网络、容器互联及自定义网络的实现。 ... [详细]
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 解决微信电脑版无法刷朋友圈问题:使用安卓远程投屏方案
    在工作期间想要浏览微信和朋友圈却不太方便?虽然微信电脑版目前不支持直接刷朋友圈,但通过远程投屏技术,可以轻松实现在电脑上操作安卓设备的功能。 ... [详细]
  • 本文详细介绍了如何在Ubuntu系统中下载适用于Intel处理器的64位版本,涵盖了不同Linux发行版对64位架构的不同命名方式,并提供了具体的下载链接和步骤。 ... [详细]
  • 嵌入式开发环境搭建与文件传输指南
    本文详细介绍了如何为嵌入式应用开发搭建必要的软硬件环境,并提供了通过串口和网线两种方式将文件传输到开发板的具体步骤。适合Linux开发初学者参考。 ... [详细]
  • 本文详细介绍了如何在云服务器上配置Nginx、Tomcat、JDK和MySQL。涵盖从下载、安装到配置的完整步骤,帮助读者快速搭建Java Web开发环境。 ... [详细]
  • CentOS 7.6环境下Prometheus与Grafana的集成部署指南
    本文旨在提供一套详细的步骤,指导读者如何在CentOS 7.6操作系统上成功安装和配置Prometheus 2.17.1及Grafana 6.7.2-1,实现高效的数据监控与可视化。 ... [详细]
  • NFS(Network File System)即网络文件系统,是一种分布式文件系统协议,主要用于Unix和类Unix系统之间的文件共享。本文详细介绍NFS的配置文件/etc/exports和相关服务配置,帮助读者理解如何在Linux环境中配置NFS客户端。 ... [详细]
  • 利用SSH隧道实现外网对局域网机器的安全访问
    本文探讨了一种常见的网络配置问题及其解决方案,即如何在外网环境下安全地访问位于局域网内的计算机。特别介绍了使用SSH反向隧道技术来实现这一目标的具体步骤和注意事项。 ... [详细]
  • 在Linux系统上构建Web服务器的详细步骤
    本文详细介绍了如何在Linux系统上搭建Web服务器的过程,包括安装Apache、PHP和MySQL等关键组件,以及遇到的一些常见问题及其解决方案。 ... [详细]
  • 近期,考虑到在Vim内部进行GDB调试、运行Python脚本和数据库连接等多样化需求,思考是否可以通过集成终端来简化这些操作,而非逐一编写Vim脚本来实现。通过研究发现,确实存在一种高效的方法——利用特定插件实现终端功能的整合。 ... [详细]
  • iTOP4412开发板QtE5.7源码编译指南
    本文详细介绍了如何在iTOP4412开发板上编译QtE5.7源码,包括所需文件的位置、编译器设置、触摸库编译以及QtE5.7的完整编译流程。 ... [详细]
  • Linux网络安装指南
    本文详细介绍了如何通过网络安装Linux操作系统,包括必要的服务配置和常见问题解决方法,旨在帮助IT专业人士提高系统部署效率。 ... [详细]
  • 在 Ubuntu 中遇到 Samba 服务器故障时,尝试卸载并重新安装 Samba 发现配置文件未重新生成。本文介绍了解决该问题的方法。 ... [详细]
author-avatar
停止离开静悄悄
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有