前言

在使用Linux过程中,自带的yum源包,不能满足的情况下,这个时候就可以考虑升级yum源了。国内用的比较多的是163镜像地址为http://mirrors.163.com/.help/centos.html 。(阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/

如笔者在运用yum安装时出现如下情况:

[Hunter@localhost /]
$sudo yum install sl
[sudo] password for Hunter: 

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates error was
12: Timeout on http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
 * base: mirrors.zju.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.njupt.edu.cn
base                                                     | 3.7 kB     00:00     
extras                                                   | 3.3 kB     00:00     
updates                                                  | 3.4 kB     00:00     
Setting up Install Process
No package sl available.
Error: Nothing to do

yum -y update 如果可以解决就好,否则可以通过如下配置方案:

【root用户下执行】

更改方法

1、进入yum配置文件目录

cd /etc/yum.repos.d/
2、备份配置文件

mv CentOS-Base.repo CentOS-Base.repo.bak
3、下载163的配置

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo,下载下来的文件名为 CentOS6-Base-163.repo
4、改名

mv CentOS6-Base-163.repo CentOS-Base.repo
5、更新数据库

yum update

【或者可以这样】:

直接搜索新的yum源直接替换CentOS-Base-repo中的文件内容
然后
yum makecache

相信学习Linux的人,整天对着一行一行的命令,没有图形界面,久了肯定会很无聊。下面介绍几个有趣的命令,无聊的时候可以玩玩(装逼可用,哈哈)

可能有的朋友系统里没有下列安装命令,并且一直安装失败,此处介绍一篇教程:

!!!重要内容,敲黑板了:安装有趣命令精准教程详解

【有趣命令集】:

  • cmatrix(像黑客帝国里面的代码雨)
wget http://www.asty.org/cmatrix/dist/cmatrix-1.2a.tar.gz
tar xvf cmatrix-1.2a.tar.gz
cd cmatrix-1.2a
yum install ncurses-devel
./configure && make && make install

使用方法:[]里是附带的选项

cmatrix [-abBflohnsVx] [-C color]

例如 cmatrix –b效果如下:
这里写图片描述
cmatrix -b -C red 把颜色变成红色,效果如下:
这里写图片描述
选项

-a :异步滚动(默认)
-b :随机粗体
-B :全部粗体
-f :force the linux $TERM type to be on
   求大神解释
-l :Linux mode (sets "matrix.fnt" font in console)
   求大神解释
-o :使用旧风格滚动(不好看)
-h :获得帮助信息
-n :不使用粗体(默认)
-s :"Screensaver" mode,exits on first keystroke
   求大神解释
-x :X window 模式,好像就是显示的符号不一样
-V :显示版本信息
-u :刷新频率,0-9,也就是滚动的快慢
-C :显示的颜色,支持green(默认),red,blue,white,yellow,cyan,
       magenta and black
在运行的状态下,直接按q,即可退出程序
  • sl(大家经常用到ls命令,但是sl又有多少人知道呢)

sudo yum install sl

直接输入sl使用,终端就会出现一辆从右到左的火车,效果如下:
这里写图片描述

  • aafire(终端出现一团火)

sudo apt-get install libaa-bin

执行aafire,效果如下:
这里写图片描述

  • oneko(终端出现一只小动物,随着你的鼠标移动奔跑)

sudo apt-get install oneko

执行oneko,效果如下:
这里写图片描述
还可以增加选项:

-position 坐标 :指定X和Y来调整猫相对老鼠的位置
-rv:将前景色和背景色对调
-fg 颜色 : 前景色 (比如 oneko -dog -fg red)。
-bg 颜色 : 背景色 (比如 oneko -dog -bg green)。

  • fortune(显示一条信息)

sudo apt-get install fortune

执行fortune,会随机出现一条信息或名言,效果如图:
这里写图片描述

  • figlet(将单词用符号拼凑出来并显示在终端)

这里写图片描述

sudo apt-get install figlet

  • cowsay(让动物说话)

sudo apt-get install cowsay

执行cowsay “linux is fun”,效果如图:
这里写图片描述

默认是一头牛,可以通过参数让它显示其他的东西
先查看有哪些东西:cowsay –l
终端会出现以下信息:

Cow files in /usr/share/cowsay/cows:
apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default
dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep
ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala
mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep
skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey
turtle tux unipony unipony-smaller vader vader-koala www

可以看到上面有很多可以选,比如选个milk
执行命令cowsay -f milk “Do youwant to drink?”,效果如图:
这里写图片描述

  • asciiquarium(把终端变成一个水族馆)
wget http://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz
tar -zxvf asciiquarium.tar.gz
cd asciiquarium_1.1/
cp asciiquarium /usr/local/bin
chmod 0755 /usr/local/bin/asciiquarium

执行命令asciiquarium,效果如图:
这里写图片描述

  • toilet

sudo apt-get install toilet

这是个命令来的,他会将字符串以彩色的ascii字符串形式输出到终端

结语

美好的未来只能通过自己的双手获取,加油!

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:23 天前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐