存档

2022年10月 的存档

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

2022年10月13日 没有评论

ssh 连接 centos 服务器时报警告:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

原因是 ssh连接的时候会传递环境变量,这个变量如在服务器没有的环境,就会报这个错误,是LC_CTYPE这个环境变量导致的提示。

对于LC_CTYPE的参数,我们一般建议设置成UTF-8,服务器上配置文件缺少相应配置参数。所以就报错了。

解决办法:
在centos上运行

vi /etc/locale.conf

内容改为:

LANG=en_US.utf8
LC_ALL=en_US.utf8
LC_CTYPE=en_US.utf8

重新连接ssh,就可以解决错误提示。

分类: Linux, 解决方案 标签: , ,

proxmox 7 :WARN: old systemd (< v232) detected, container won't run in a pure cgroupv2 environment! Please see documentation -> container -> cgroup version.

2022年10月13日 没有评论

proxmox 升到7,或是安装7后的版本在使用旧的pct模版LXC的 Centos 7 无法开机,出现以下错误提示:

WARN: old systemd (< v232) detected, container won't run in a pure cgroupv2 environment! Please see documentation -> container -> cgroup version.

TASK WARNINGS: 1

解決方法如下

vim /etc/default/grub

找到以下
GRUB_CMDLINE_LINUX_DEFAULT=”quiet”

改成以下

GRUB_CMDLINE_LINUX_DEFAULT=”systemd.unified_cgroup_hierarchy=0 quiet”

运行更新grub

update-grub

重启服务器
reboot

centos6 yum源不能使用解决办法

2022年10月2日 没有评论

2020年11月30日 centos6各大开源镜像站已经停止维护了!但是阿里源还是可以用的通道,因为他的centos-vault仓库里放了之前版本的centos的包。

只需要在centos命令行界面下执行一下几条命令即可解决问题。命令如下:

1
2
3
4
5
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo 
yum clean all
yum makecache

如无法下载Centos-6-Vault-Aliyun.repo文件,可以将以下内容复制存为文件使用即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
分类: Linux, 解决方案 标签: ,