fedora安装后的一些配置

(mirror)源

换源

默认从fedora官网下载太慢,考虑换用国内的源(镜像站点),推荐中科大阿里云浙大网易等的源。

比如我用浙大ZJU的源http://mirrors.zju.edu.cn and follow the page's instruction.,可按照配置生成器进行repo文件的生成,并根据提示保存配置,

e.g.

请删除/etc/yum.repos.d/fedora.repo和/etc/yum.repos.d/fedora-updates.repo,然后在/etc/yum.repos.d目录中建立fedora.repo文件,并填入下列内容

[fedora]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/releases/$releasever/Everything/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [fedora-debuginfo]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/releases/$releasever/Everything/$basearch/debug/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [fedora-source]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/releases/$releasever/Everything/source/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [updates]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [updates-debuginfo]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/updates/$releasever/$basearch/debug/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [updates-source]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/updates/$releasever/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

rpmfusion 好用的第三方源

To download and install more useful software, use rpmfusion.

rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

(font)字体

infinality字体渲染

The default font is ugly. Copy Microsoft's truetype font is not a good method, it's nasty.

I use infinality. Though the website don't update anymore.

First, download fontconfig-infinality and freetype-infinality:

wget http://www.infinality.net/fedora/linux/20/noarch/fontconfig-infinality-1-20130104_1.noarch.rpm
wget http://www.infinality.net/fedora/linux/20/x86_64/freetype-infinality-2.4.10-1.20120615_01.fc17.x86_64.rpm

then install them using rpm command:

sudo rpm -ivh fontconfig-infinality-1-20130104_1.noarch.rpm freetype-infinality-2.4.10-1.20120615_01.fc17.x86_64.rpm

(maybe you have to solve the dependencies manually)

then, set the font renderr style using infinality script. I choose osx style. the command is:

sudo /etc/fonts/infinality/infctl.sh setstyle

and choose the number you like.

MONACO字体

我喜欢用MONACO作为等宽字体。

wget http://jsdx.sc.chinaz.com/Files/DownLoad/font2/908.rar   # 下载MONACO字体
sudo yum install unrar # 下载unrar:
unrar x 908.rar # 解压
cd 908
sudo mkdir -p /usr/share/fonts/my_font
sudo mv MONACO.TTF /usr/share/fonts/my_font/
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv # 更新字体缓存

好了,现在可以在终端中选择MONACO作为显示的等宽字体了。

build tools

sudo yum install gcc-c++ cmake

opencv

use yum command to list packages related to opencv:

yum list *opencv*

and select proper packages(that is, packages you need) to download:

sudo yum install opencv-core opencv opencv-devel opencv-python

close SELinux

SELinux is useless for common people. Just close it.

sudo vim /etc/selinux/config

and change the content to:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled # here we modify "enforcing" to "disabled"
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

and we need a reboot to disable SELinux. If don't disable SELinux, apps like Chrome can't be used happily

chrome

First, download chrome. I don't like using a repo for chrome, since every time the system updates, it speed down.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

then use yum to download depences:

yum install redhat-lsb
yum install libXScrnSaver

now let's install chrome:

sudo rpm -ivh google-chrome-stable_current_x86_64.rpm

python

这里配置了python、python-devel以及pip

sudo dnf install python python-devel python-pip

然后创建pip的用户自配置文件,使用阿里云的源来加速访问,即创建并编辑~/.pip/pip.conf,内容为:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

shadowsocks

Here I use a command line tool for shadowsocks.

# sudo easy install pip
sudo pip install shadowsocks

then download SwitchySharp.crx and drop it to your chrome extension, and config it.

Shadowsocks is a socks5 agent, and the default local port is 1080.

then remember to create a shadowsocks-config file, writing your config as following(you can just copy them from the file you http://downloaded from portal.shadowsocks.com):

{
"server": "jp01-19.ssv4.net",
"server_port": "12345",
"local_port": 1080,
"password": "JabcdefghijX",
"timeout": 600,
"method": "aes-256-cfb"
}

and use the following command to start shadowsocks:

sslocal -c shadowsocks.cfg

git

git配置ssh

ssh-keygen -t rsa -C "zchrissirhcz"//注意。zchrissirhcz为用户名
//然后三次回车
cat /home/forwhat.cn/.ssh/id_rsa.pub
//复制cat出来的内容

然后到github上个人账户设置中配置SSH Keys:把cat出来的内容贴上去

vim

I use vundle to manage my vim plugins.

sudo yum install vim
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
mkdir -p workspace/gitwhat
cd workspace/gitwhat
git clone https://github.com/zchrissirhcz/dotfiles
mkdir -p ~/.vim/colors
cp molokai.vim ~/.vim/colors

then open vim and do bundle install:

:BundleInstall

fcitx输入法

不必卸载默认的ibus。

sudo yum install fcitx-pinyin
sudo yum install fcitx-configtool
sudo yum install im-chooser
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
im-chooser

弹出的对话框中选择fcitx。重启后可以使用。

配置: 使用 fcitx-configtool 进行配置。

在全局配置的快件键->显示高级选项中,我把切换激活/非激活输入法设定为左shift,输入法切换键设定为Ctrl+Space。

如果ctrl+空格无法设定,结果显示是LCtrl,也就是左Control键。这种情况是你的Ctrl+Space被别的程序捕获了,比如我在系统设置->全部设置->键盘->快捷键->打字->切换至下个输入源,这里设定为了Ctrl+Space,这里改掉,fcitx那里就可以设定Ctrl+Space来激活输入法了。

快捷键

配置开启终端快捷键

设置->键盘->快捷键->自定义快捷键->添加:

name:terminal
command:/usr/bin/gnome-terminal
#按键设定为Ctrl+Alt+T

配置截屏快捷键

mkdir ~/bin
cd ~/bin
vim screenshot

添加如下内容:

#!/bin/bash
gnome-screenshot -ai

添加软链接并添加可执行权限:

sudo ln -sf /home/chris/bin/screenshot /usr/bin/screenshot
chmod +x ~/bin/screenshot

最后到:设置->键盘->快捷键->自定义快捷键->添加:

name:screenshot
command:screenshot
#按键设定为Ctrl+Alt+Q

PS1变量

在.bash_rc中添加:

export PS1="$(tput setaf 1)\w\n\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h\[$(tput setaf 5)\]\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$\[$(tput sgr0)\] "

美化终端显示

cd ~
wget --no-check-certificate https://github.com/seebi/dircolors-solarized/raw/master/dircolors.ansi-universal
#or
#wget http://download.bbkanba.com/dircolors mv dircolors.ansi-universal ~/.dir_colors
eval `dircolors ~/.dir_colors`
cat >> ~/.bashrc <<ALLEND
########################################
if [ -x /usr/bin/dircolors ]; then
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias tree='tree -C'
fi
########################################
ALLEND
source ~/.bashrc
ls

取消终端下光标闪烁

gsettings set org.gnome.desktop.interface cursor-blink false

virtualbox虚拟电脑目录的移动

比如原来放在$HOME下,现在空间不够了,但是/opt是有空间的。怎样移动过去呢?

先用命令移动整个目录到目标位置

再设置全局的虚拟电脑目录(管理-》全局设定-》默认虚拟电脑位置)

(可能要修改/etc下的一个vbox配置文件)

然后发现原来的vbox都报错了打不开 刷新也没用

在vbox主界面中删除原有的vbox

在vbox主界面 控制-》注册-》选择新位置的vdi文件

vdi文件扩容

VBoxManage modifyhd         <uuid>|<filename>     [--resize <megabytes>|--resizebyte <bytes>]

比如:

vboxmanage modifyhd fedora22.vdi --resize 20480

然后进入系统(你当然是要在关闭它时候才修改vdi文件大小的。。),发现还是原来容量,但是有了一块‵空闲区域`。

fdisk命令已经不太会用了。不过gparted很好用:

sudo yum install gparted

zsh

sudo yum install zsh
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
chsh

在终端中打开文件夹,以及在文件夹中打开终端

sudo dnf install nautilus-terminal nautilus-open-terminal

fedora安装后的配置的更多相关文章

  1. 基于iSCSI的SQL Server 2012群集测试(二)--SQL群集安装后初始化配置测试

    4.群集安装后初始化配置测试 4.1 禁用full-text 服务和Browser服务 Full-text服务:公司目前暂不使用,需在两个节点上分别禁用 Browser服务:为保证安全,建议将Brow ...

  2. Linux 虚拟机安装后的配置和一些命令符笔记

    一.安装后的配置 1.设在终端的字体为等宽字体 比如:DejaVu Sans Mono 2.将当前的普通用户加入到sudo用户组adduser en sudochmod +w /etc/sudoers ...

  3. Ubuntu 安装后的配置及美化(二)

    Ubuntu安装后的配置与美化(二) 上篇文章讲了安装ubuntu后的一系列基础的配置,已经可以满足日常的使用了,这篇文章讲一下安装 IDE 及一些其他的配置. 1.安装 SSR 下载 SSR 客户端 ...

  4. Ubuntu 安装后的配置及美化(一)

    Ubuntu 安装后的配置及美化(一) 记录一下 完成后的主界面. 配置 1.更新源为阿里云 找到 软件和更新 选项,更新源为阿里云的源. 在 其他软件 中将 Canonical合作伙伴 打上勾. 然 ...

  5. fedora安装后,yum命令不能使用,Cannot retrieve metalink for repository: fedora. Please verify its path and try again 解决方法

    fedora安装后,yum命令不能使用,Cannot retrieve metalink for repository: fedora. Please verify its path and try ...

  6. Oracle BI Publisher 企业版安装后的配置(BI Publisher Enterprise Edition)

    Oracle BI Publisher 企业版安装后的配置(BI Publisher Enterprise Edition) (版权声明,本人原创或者翻译的文章如需转载,如转载用于个人学习,请注明出处 ...

  7. Manjaro安装后简单配置

    一个相见恨晚的 Linux 操作系统 Manjaro 到底有多受欢迎? DistroWatch是一个包含了各种Linux发行版及其他自由/开放源代码的类Unix操作系统. (如OpenSolaris. ...

  8. Centos7 Minimal 安装后 初始化配置

    安装完成后初始化配置 1:更新yum yum upgrade 2: 安装基础命令 #yum -y install vim* lrzsz gcc-c++ pcre pcre-devel zlib zli ...

  9. fedora27安装后的配置工作(持续更新)

    换源 没什么可说的,安装后更换国内软件源是必须做的事,推荐更换阿里的镜像源.换源教程 添加epel源 EPEL (Extra Packages for Enterprise Linux)是基于Fedo ...

随机推荐

  1. JSP 脚本中的 9 个内置对象

    JSP 脚本中包含了 9 个内置对象,这 9 个内置对象都是 Servlet API 接口的实例,只是 JSP 规范对它们进行了默认初始化. 这 9 个内置对象如下: 1.application:ja ...

  2. 【题解】彩色树 51nod 1868 虚树 树上dp

    Prelude 题目在这里:ο(=•ω<=)ρ⌒☆ Solution 蒟蒻__stdcall的第一道虚树题qaq. 首先很容易发现,这个排列是假的. 我们只需要求出每对点之间的颜色数量,然后求个 ...

  3. Java中String的替换函数:replace与replaceAll的区别

    例如有如下x的字符串  String x = "[kllkklk\\kk\\kllkk]"; 要将里面的"kk"替换为++,可以使用两种方法得到相同的结果  r ...

  4. OpenCV---膨胀与腐蚀

    膨胀 腐蚀 一:膨胀实现dilate import cv2 as cv import numpy as np def dilate_demo(image): #膨胀 print(image.shape ...

  5. NOIP模拟2

    期望得分:100+100+100=300 实际得分:70+40+20=130 T1 [SCOI2007]kshort弱化版 Description 有n个城市和m条单向道路,城市编号为1~n.每条道路 ...

  6. 【BZOJ】3036: 绿豆蛙的归宿

    [题意]给定DAG带边权连通图,保证所有点都能到达终点n,每个点等概率沿边走,求起点1到终点n的期望长度.n<=10^5. [算法]期望DP [题解]f[i]表示到终点n的期望长度. f[n]= ...

  7. 【BZOJ】1023: [SHOI2008]cactus仙人掌图 静态仙人掌(DFS树)

    [题意]给定仙人掌图(每条边至多在一个简单环上),求直径(最长的点对最短路径).n<=50000,m<=10^7. [算法]DFS树处理仙人掌 [题解]参考:仙人掌相关问题的处理方法(未完 ...

  8. 【CodeForces】671 B. Robin Hood

    [题目]B. Robin Hood [题意]给定n个数字的序列和k次操作,每次将序列中最大的数-1,然后将序列中最小的数+1,求最终序列极差.n<=5*10^5,0<=k<=10^9 ...

  9. styled-components真的好吗?

    最近在学习react,然后遇到react中css该怎么写这个问题,上知乎上看了好多大牛都说styled-components好用是大势所趋. 但我自己用了感觉体验却很差,我在这里说说我为啥觉得styl ...

  10. 【leetcode 简单】第二十题 合并两个有序数组

    给定两个有序整数数组 nums1 和 nums2,将 nums2 合并到 nums1 中,使得 num1 成为一个有序数组. 说明: 初始化 nums1 和 nums2 的元素数量分别为 m 和 n. ...