# linux 使用 tar 打包压缩和分卷压缩

参考:linux 使用 tar 打包压缩和分卷压缩_tar 分卷 - CSDN 博客

tar -zcf ROOT.tar.gz ROOT
-z压缩  -c归档(打包) -f指定包的文件名

tar -zxf ROOT.tar.gz -C /mnt
-x解压  -C指定解压目录(可以不写)

## 使用tar分卷打包压缩
tar -zcf - ROOT | split -b 10m - ROOT.tar.gz  (按10MB分割,也可以写1G等等自定义大小)

## 首先cat命令将分卷包合拼,再解压
cat ROOT.tar.gz* > ROOT.tar.gz
tar -zxf ROOT.tar.gz

# ghostscript 显示字体缺失

Error: /invalidfont in /findfont
Operand stack:
   1   Helvetica-Bold
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false  ray_pop   1883   1   3   %oparray_pop   --nostringval--   1867   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   tringval--   2   %stopped_push   --nostringval--   1836   2   3   %oparray_pop
Dictionary stack:
   --dict:1167/1684(ro)(G)--   --dict:0/20(G)--   --dict:98/200(L)--
Current allocation mode is local
Last OS error: Not a directory
Current file position is 174043
GPL Ghostscript 9.07: Unrecoverable error, exit code 1

Ghostscript 的默认安装已包含一些字体。于是直接运行 sudo yum install ghostscript 重装,问题得到解决

# 运行 yum 时显示进行被占用

参考:运行 yum 命令出现 “Existing lock /var/run/yum.pid: another copy is running as pid...” 解决方法

# 报错
Existing lock /var/run/yum.pid: another copy is running as pid...

# 运行如下命令解决
rm -f /var/run/yum.pid
/sbin/service yum-updatesd restart

# 无法连接 yum 的源

参考:已解决 centos7 yum 报错:cannot find a valid baseurl for repo:base/7/x86_64 的解决方案

# 执行install时报错
scorr@head1 test ~> sudo yum install xclock
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


# 执行info时报错
scorr@head1 test ~> yum info
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
 * base: mirrors.bupt.edu.cn
 * epel: mirrors.huaweicloud.com
 * extras: mirrors.bupt.edu.cn
 * updates: mirrors.bupt.edu.cn
base/7/x86_64/primary_db       FAILED