Total Pageviews

Tuesday 12 June 2018

linux的发行版本





各发行版的特点:

1
2
3
4
5
Redhat
      fedora 全功能版,不稳定
      centos 社区维护版 新浪,网易 服务都采用的版本
红旗 Linux
suse 欧洲用的多
linux 系统的应用领域
基于linux的企业服务器
嵌入式应用
linux 在电影娱乐
linux 学习方法
1
2
3
4
5
6
7
1 详细的报错信息 邮件称呼
2 帮助文档,查找,实例
3 英语
 COMMAND NOT FOUND   未找到 命令 ?
 NO SUCH file or directory  没有找到文件或者 地址?
4 忘掉windows的思维方式
5 计划 专注 坚持 练习

更改/home 分区挂载点

ubuntu 难免要弄坏,然后重装,重装的时候,可以将手动更改 /etc/fastab 这个文件来指定文件系统的加载位置。前提是从前系统的 /home 与/ 分区 不在同一个分区中。
1
2
3
4
sudo gedit /etc/fastab

# home was on /dev/sda9 during installation
UUID=9a1eabc7-17ef-4033-ae61-48549c0f1483 /home           ext4    defaults  0       0
例如我修改后的,然后保存,重启。
1
2
3
4
5
6
7
8
9
10
11
12
13
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
UUID=57006982-8ad1-442f-a7d6-c56ee2e68306 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda8 during installation
UUID=43060bdb-2b29-424f-88b7-84ad64de7851 none            swap    sw              0       0
# home was on /dev/sda9 during installation
UUID=9a1eabc7-17ef-4033-ae61-48549c0f1483 /home           ext4    defaults  0       0

修改源

可以自定义 源,值得注意的是,当通过设置——》软件源——》服务器位置的时候,会重写掉我们自定义的文件。
1
sudo gedit /etc/apt/sources.list
然后添加下面,保存,更新即可。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
## 中国的骨干源
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

## 阿里云
deb http://mirrors.aliyun.com/ubuntu trusty main restricted
deb-src http://mirrors.aliyun.com/ubuntu trusty main restricted
deb http://mirrors.aliyun.com/ubuntu trusty multiverse
deb-src http://mirrors.aliyun.com/ubuntu trusty multiverse
deb http://mirrors.aliyun.com/ubuntu trusty-updates multiverse
deb-src http://mirrors.aliyun.com/ubuntu trusty-updates multiverse
deb http://mirrors.aliyun.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu trusty-backports main restricted universe multiverse

常用软件

1
2
3
4
5
6
7
8
9
10
# 安装fcitx-googlepinyin 输入法
sudo apt-get install ibus-googlepinyin

# 新立得软件包 (synaptic) 和经典菜单(classicMenu Indicator)
sudo apt-get install synaptic

# 在任务栏显示网速
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install indicator-netspeed

pip 镜像加速

1
pip install notebook --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple
类似的还可以编辑全局文件~/.pip/pip.con实现自动使用镜像地址
1
2
3
4
5
6
7
8
9
10
On Unix and Mac OS X the configuration file is: $HOME/.pip/pip.conf
On Windows, the configuration file is: %HOME%\pip\pip.ini

# on Ubuntu LTS
cd ~
gedit .pip/pip.conf


[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

GCC 降级和多版本共存

查看已安装版本 gcc -v ,我们可以通过修改优先级的方法来实现gcc 、g++ 的多版本共存。
1
2
3
4
5
6
安装 gcc-4.7
sudo apt-get install gcc-4.7

设置当前系统两个版本gcc 及其优先级
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 80
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60
通过输入下面的指令,查看当前 gcc 的配置情况
1
sudo update-alternatives --config gcc
1
2
3
4
5
6
7
8
pi@MINDCONT:~$ sudo update-alternatives --config gcc
有 2 个候选项可用于替换 gcc (提供 /usr/bin/gcc)。

  选择       路径            优先级  状态
------------------------------------------------------------
* 0            /usr/bin/gcc-4.7   80        自动模式
  1            /usr/bin/gcc-4.7   80        手动模式
  2            /usr/bin/gcc-5     60        手动模式
对于 g++ 同理 .
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sudo apt-get install g++-4.7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 80
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 60
sudo update-alternatives --config g++
pi@MINDCONT:~$ sudo update-alternatives --config g++

 2 个候选项可用于替换 g++ (提供 /usr/bin/g++)。

  选择       路径            优先级  状态
------------------------------------------------------------
* 0            /usr/bin/g++-4.7   80        自动模式
  1            /usr/bin/g++-4.7   80        手动模式
  2            /usr/bin/g++-5     60        手动模式

要维持当前值[*]请按<回车键>,或者键入选择的编号。

No comments:

Post a Comment