Linux下C编程入门(1)

Linux系统的介绍(以下以Manjaro最新版为例子):

一、系统的安装:

  1、可以直接使用U盘做一个live usb的启动盘,在bios中设置从U盘启动即可拥有linux系统,如果是新式bios需要将secrut boot设置项关掉,按照向导操作即可。

  2、可以借助虚拟机体验,安装virtual box最新版本,注意系统的版本(32位还是64位),倒入我给你们的安装好的镜像文件,直接导入,启动运行即可。

  3、可以安装win10的linux子系统,简单体验即可,只是以后的命令稍有不同。

  4、可以使用物理机直接安装,这个可以向周围人求助,也可以到网上求助,我的学生可以直接找我,安装加配置过程大概需要1~2个小时即可。

二、系统配置:

  1、配置软件的命令,须使用root权限:

    (1)、vi  /etc/pacman.d/mirrorlist 文件,大概如下:                    配置软件源,加快下载和安装的速度,选择自己最快的软件源即可。

  1 ##
  2 ## Manjaro Linux default mirrorlist
  3 ## Generated on 2017-10-28 05:27
  4 ##
  5 ## Please use 'pacman-mirrors -f NUMBER' to modify mirrorlist
  6 ## (Use 0 for all mirrors)
  7 ##
  8
  9 ## Country : China
 10 Server = http://mirrors.tuna.tsinghua.edu.cn/manjaro/stable/$repo/$arch
 11
 12 ## Country : China
 13 Server = https://mirrors.ustc.edu.cn/manjaro/stable/$repo/$arch
 14
 15 ## Country : Japan
 16 Server = http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/stable/$repo/$arch
 17
 18 ## Country : France
 19 Server = http://kibo.remi.lu/stable/$repo/$arch
 20
 21 ## Country : Australia
 22 Server = http://manjaro.mirror.serversaustralia.com.au/stable/$repo/$arch
 23
 24 ## Country : United_Kingdom
 25 Server = http://manjaro.mirrors.uk2.net/stable/$repo/$arch
 26
 27 ## Country : Belarus
 28 Server = http://mirror.datacenter.by/pub/mirrors/manjaro/stable/$repo/$arch
 29
 30 ## Country : United_States
 31 Server = http://mirror.dacentec.com/manjaro/stable/$repo/$arch
 32
 33 ## Country : United_States
 34 Server = http://mirror.solarvps.com/manjaro/stable/$repo/$arch
 35
 36 ## Country : Hungary
 37 Server = http://mirror.infotronik.hu/mirrors/pub/manjaro/stable/$repo/$arch
 38
 39 ## Country : Indonesia
 40 Server = http://kambing.ui.ac.id/manjaro/stable/$repo/$arch
 41
 42 ## Country : Portugal
 43 Server = http://manjaro.barata.pt/stable/$repo/$arch
 44
 45 ## Country : Taiwan
 46 Server = http://free.nchc.org.tw/manjaro/stable/$repo/$arch
 47
 48 ## Country : Bulgaria
 49 Server = http://manjaro.telecoms.bg/stable/$repo/$arch
 50
 51 ## Country : Austria
 52 Server = http://mirror.inode.at/manjaro/stable/$repo/$arch
 53
 54 ## Country : Indonesia
 55 Server = http://kartolo.sby.datautama.net.id/manjaro/stable/$repo/$arch
 56
 57 ## Country : Germany
 58 Server = http://mirror.ragenetwork.de/manjaro/stable/$repo/$arch
 59
 60 ## Country : United_Kingdom
 61 Server = http://mirror.catn.com/pub/manjaro/stable/$repo/$arch
 62
 63 ## Country : Spain
 64 Server = http://ftp.caliu.cat/manjaro/stable/$repo/$arch
 65
 66 ## Country : Hong_Kong
 67 Server = http://ftp.cuhk.edu.hk/pub/Linux/manjaro/stable/$repo/$arch
 68
 69 ## Country : Australia
 70 Server = http://manjaro.melbourneitmirror.net/stable/$repo/$arch
 71
 72 ## Country : South_Africa
 73 Server = http://mirror.is.co.za/mirrors/manjaro.org/stable/$repo/$arch
 74
 75 ## Country : United_States
 76 Server = https://mirrors.ocf.berkeley.edu/manjaro/stable/$repo/$arch
 77
 78 ## Country : Germany
 79 Server = https://mirror.netcologne.de/manjaro/stable/$repo/$arch
 80
 81 ## Country : United_States
 82 Server = https://mirror.clarkson.edu/manjaro/stable/$repo/$arch
 83
 84 ## Country : United_Kingdom
 85 Server = https://www.mirrorservice.org/sites/repo.manjaro.org/repos/stable/$repo/$arch
 86
 87 ## Country : Netherlands
 88 Server = https://manjaro.mirror.wearetriple.com/stable/$repo/$arch
 89
 90 ## Country : United_States
 91 Server = https://mirror.math.princeton.edu/pub/manjaro/stable/$repo/$arch
 92
 93 ## Country : Chile
 94 Server = http://manjaro.dcc.uchile.cl/stable/$repo/$arch
 95
 96 ## Country : Denmark
 97 Server = https://www.uex.dk/repos/manjaro/stable/$repo/$arch
 98
 99 ## Country : Bulgaria
100 Server = https://manjaro.ipacct.com/manjaro/stable/$repo/$arch
101
102 ## Country : Germany
103 Server = https://mirror.alpix.eu/manjaro/stable/$repo/$arch
104
105 ## Country : Canada
106 Server = https://osmirror.org/manjaro/stable/$repo/$arch
107
108 ## Country : Belgium
109 Server = https://manjaro.cu.be/stable/$repo/$arch
110
111 ## Country : Netherlands
112 Server = https://nl.mirror.babylon.network/manjaro/stable/$repo/$arch
113
114 ## Country : France
115 Server = https://fr.mirror.babylon.network/manjaro/stable/$repo/$arch
116
117 ## Country : Russia
118 Server = https://mirror.yandex.ru/mirrors/manjaro/stable/$repo/$arch
119
120 ## Country : Czech
121 Server = https://mirror.dkm.cz/manjaro/stable/$repo/$arch
122
123 ## Country : Romania
124 Server = http://mirrors.serverhost.ro/manjaro/packages/stable/$repo/$arch
125
126 ## Country : Ecuador
127 Server = https://mirror.cedia.org.ec/manjaro/stable/$repo/$arch
128
129 ## Country : Costa_Rica
130 Server = https://mirrors.ucr.ac.cr/manjaro/stable/$repo/$arch
131
132 ## Country : United_Kingdom
133 Server = http://repo.manjaro.org.uk/stable/$repo/$arch
134
135 ## Country : Germany
136 Server = https://manjaro-mirror-a.alpix.eu/stable/$repo/$arch
137
138 ## Country : Denmark
139 Server = https://mirrors.dotsrc.org/manjaro/stable/$repo/$arch
140
141 ## Country : Germany
142 Server = https://repo.rhindon.net/manjaro/stable/$repo/$arch
143
144 ## Country : Germany
145 Server = http://babyname.tips/mirrors/manjaro/stable/$repo/$arch
146
147 ## Country : Germany
148 Server = http://ftp.tu-chemnitz.de/pub/linux/manjaro/stable/$repo/$arch
149
150 ## Country : Singapore
151 Server = https://download.nus.edu.sg/mirror/manjaro/stable/$repo/$arch
152
153 ## Country : France
154 Server = http://ftp.free.org/mirrors/repo.manjaro.org/repos/stable/$repo/$arch
155
156 ## Country : Netherlands
157 Server = https://mirror.koddos.net/manjaro/stable/$repo/$arch
158
159 ## Country : Germany
160 Server = https://ftp.halifax.rwth-aachen.de/manjaro/stable/$repo/$arch
161
162 ## Country : Turkey
163 Server = http://ftp.linux.org.tr/manjaro/stable/$repo/$arch
164
165 ## Country : Ireland
166 Server = https://ftp.heanet.ie/mirrors/manjaro/stable/$repo/$arch
167
168 ## Country : Portugal
169 Server = http://ftp.dei.uc.pt/pub/linux/manjaro/stable/$repo/$arch
170
171 ## Country : Netherlands
172 Server = https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/stable/$repo/$arch
173
174 ## Country : Netherlands
175 Server = http://ftp.snt.utwente.nl/pub/linux/manjaro/stable/$repo/$arch
176
177 ## Country : Sweden
178 Server = https://ftp.lysator.liu.se/pub/manjaro/stable/$repo/$arch
179
180 ## Country : Germany
181 Server = https://mirror.netzspielplatz.de/manjaro/packages/stable/$repo/$arch

  文件说明:

    (1)、以#开始的行都是被注释掉的,文件在被解析时是无用的

    (2)、容易看出前7行都为注释

    (3)、第9行## Country : China虽然是注释行,表明以下是中国的内容

    (4)、第10行Server = http://mirrors.tuna.tsinghua.edu.cn/manjaro/stable/$repo/$arch文件主要有

      a、Server=设置Server变量,内容在赋值符号右边

      b、http://mirrors.tuna.tsinghua.edu.cn说明使用清华大学的的镜像服务,九江的访问不够稳定

      c、manjaro对应的linux镜像名称与发行版本名称一致

      d、stable说明使用的稳定源,可以是testing或unstable源,有风险

      e、后面的$repo/$arch就是套路,知道有这个内容就行了

    (5)、我一般使用中国科大的软件源,但是清华的源是第一个,只要将第10行注释掉,也就是在行首加上个#就好了

    (6)、这样实际起作用的就是第13行代码,其他依次类推,更加激进的是将不需要的行全部删除即可。

  2、软件更改(需要有root的权限):

    (1)、在线安装软件:pacman -S vim

    (2)、离线安装软件:pacman -U vim

    (3)、查询系统软件:pacman -Q vim

    (4)、删除已装软件:pacman -R vim

    (5)、升级全部软件:pacman -Syyu

  3、安装必备的软件:

    (1)、开发工具:gcc make gdb 前面三个必须,kdgb netbeans  okteta  bless选装等

    (2)、编辑工具:vim kate atom vscode等任选一个即可

    (3)、其他工具:qstardict字典翻译  kicad电路制版  umlet uml设计工具 arduino世界级的单片机开发工具 Fritzing开源的软件仿真工具

    (4)、教育软件:Ktouch Ktuitle step等

    (5)、游戏软件:0AD实时战争类 Wesnoth策略类 Chromium-bsu射击类游戏 SuperTux竞速类游戏 Ksudoku 数独游戏  pingus儿童类游戏 frozen bubble泡泡龙,assaultcube枪战类游戏相当不错 Xonotic也不错

    (6)、其他推荐:chromium游览器的王者 firefox浏览器的万能 smplay看电影和听音乐的选择  kodi linux下的多媒体中心  VLC也不错  deepin-screen-recorder深度录屏工具也不错  simplescreenrecorder也不错

    

原文地址:https://www.cnblogs.com/guochaoxxl/p/7745407.html