AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1250681
Accepted
Caio Vieira
Caio Vieira
Asked: 2020-06-16 13:03:18 +0800 CST2020-06-16 13:03:18 +0800 CST 2020-06-16 13:03:18 +0800 CST

.profile 没有被采购

  • 772

前段时间我安装了byobu并运行byobu-enable它仍然没有自动启动,我只是忽略了它,因为我可以直接按超级并打开byobu终端。但是现在我尝试设置一些变量并在以下位置找到了这一行~/.profile:

byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true

甚至当我在那里设置任何东西时,~/.profile文件也永远不会被获取。我知道它永远不会被采购,因为我$HOME/bin被设置在那里并echo $PATH输出:

/usr/local/clang_9.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

当我在source ~/.profile那里运行所有东西时,一切都完全符合我的预期,但这不是 .profile 行为。

我在这里看过这里和其他帖子 ,但仍然一无所获。

我的 ~/.profile :

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

_byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true

有任何想法吗?

编辑:我确实有$HOME/bin目录

kubuntu environment-variables .profile
  • 1 1 个回答
  • 351 Views

1 个回答

  • Voted
  1. Best Answer
    Caio Vieira
    2020-07-15T20:27:30+08:002020-07-15T20:27:30+08:00

    所以,我切换了发行版(出于其他原因),我发现了问题,以防有人需要它。

    我使用 zsh 作为我的主 shell,它使用.zprofile而不是.profile, bash 使用了女巫。所以解决方案是使用该.zprofile文件或使用 bash 只是为了使用.profile,然后,在它获得来源后,您可以将 shell 更改为 zsh(或 ksh、dash、fish 等),您只需要添加export SHELL=/bin/zsh您的.profile

    chsh -s $(which bash)考虑到您已which安装命令,您可以轻松地更改 shell 。

    • 0

相关问题

  • 修复 USB 驱动器自动通知

  • 如何在 Kubuntu 中获得 Cantor 的 R 后端?

  • 如何设置环境变量?

  • 为什么我的 Kubuntu 会话在恢复后需要相当长的时间才能响应?

  • 在哪里可以找到有关 /etc/environment 文件格式的文档?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve