admin 管理员组

文章数量: 1184232

Ubuntu 22.04 上,如果你在 /etc/profile 文件中添加了环境变量但没有生效


解决方法:检查文件权限:确保 /etc/profile 文件的权限正确设置为可读取和可执行(至少对于所有者)。使用以下命令检查和更改文件权限:

ls -l /etc/profile
sudo chmod +rx /etc/profile

再执行 source 命令:打开终端,并执行以下命令来手动加载 /etc/profile 文件:

source /etc/profile

本文标签: 解决方法 但没 环境变量 文件 系统