如何在 ubuntu 中永久修复 Howbrew 路径问题 [英] How to Fix Howbrew path issue permanently in ubuntu

查看:24
本文介绍了如何在 ubuntu 中永久修复 Howbrew 路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 linuxbrew 安装节点.这很有效,除非我只能在执行以下路径导出后才能使用节点.

I am using linuxbrew to install node. That works well, unless, for the fact that I can only use node after I do the following path export.

export PATH="/home/ericel/.linuxbrew/bin:$PATH"

如果我关闭该终端并打开一个新终端,我仍然需要执行相同的 PATH 导出才能使我的节点正常工作.

If I close that terminal and open a new terminal, I will still have to do the same PATh export in order to get my node working.

有没有办法永久解决这个问题?我做 brew doctor,我得到以下说明:

Is there anyway to fix this permanently? I do brew doctor, I get the following instructions:

ericel@ericel-X401A:~$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: /usr/bin occurs before /home/ericel/.linuxbrew/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
  xzmore
  unlzma
  lzcmp
  brew
  xzegrep
  lzgrep
  lzdiff
  lzless
  lzma
  pkg-config
  xzfgrep
  xzdiff
  xz
  lzfgrep
  lzcat
  lzegrep
  unxz
  xzgrep
  xzcat
  xzless
  lzmore
  lzmainfo
  xzcmp

Consider setting your PATH so that /home/ericel/.linuxbrew/bin
occurs before /usr/bin. Here is a one-liner:
  echo 'export PATH="/home/ericel/.linuxbrew/bin:$PATH"' >> ~/.bash_profile

Warning: Homebrew's bin was not found in your PATH.
Consider setting the PATH for example like so
  echo 'export PATH="/home/ericel/.linuxbrew/bin:$PATH"' >> ~/.bash_profile

Warning: You have a non-Homebrew 'pkg-config' in your PATH:
  /usr/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
this other pkg-config.

Warning: Homebrew's share was not found in your XDG_DATA_DIRS but you have
this variable set to include other locations.
Some programs like `vapigen` may not work correctly.
Consider setting the XDG_DATA_DIRS for example like so
    echo 'export XDG_DATA_DIRS="/home/ericel/.linuxbrew/share:$XDG_DATA_DIRS"' >> ~/.bash_profile

但即使这样做,node 也将只为那个终端工作.我使用的是 ubuntu 16.**

But even after doing that, node will work just for that one terminal. I am using ubuntu 16.**

推荐答案

刚遇到同样的错误.我想是的,因为我首先从官方页面说明中安装了 linuxbrew,然后我使用了 apt-get.

Just had the same error. I think it was, because I installed linuxbrew at first from official page instructions and then i used apt-get.

所以我删除了apt-get安装

So I removed the apt-get installation

sudo apt remove linuxbrew-wrapper

然后只是将路径添加到

nano ~/.bashrc

如官方文档中所述

echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile

然后你需要打开新的终端才能生效.

then you need to open new terminal for it to take effect.

这篇关于如何在 ubuntu 中永久修复 Howbrew 路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆