根据ros wiki,为了设置环境,我输入
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
错误是
/opt/ros/kinetic/setup.bash:.:8: no such file or directory: /home/pikashun/setup.sh
Run Code Online (Sandbox Code Playgroud)
在~/.bashrc文件中,有一行source /opt/ros/kinetic/setup.bash。
我在 WSL 上使用 Ubuntu。我该如何改进?
谢谢你!
我正在使用 Ubuntu Bash,并在 WSL、Windows 10 上安装了 ZSH。
命令(ConEmu 任务设置):
"%WINDIR%\System32\wsl.exe ~" -cur_console:p
Run Code Online (Sandbox Code Playgroud)
命令(ConEmu 集成设置):
-Single -run {Bash::ubuntu} -cur_console:n
Run Code Online (Sandbox Code Playgroud)
ConEmu 中集成的所有其他终端我都可以在当前项目文件夹中右键单击打开,但 Ubuntu Bash 始终在默认文件夹 (~) 中打开。
我尝试了此处描述的设置: ConEmu + WSL:在当前选项卡目录中打开新控制台
因此,使用命令:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -C~ -cur_console:pm:/mnt
Run Code Online (Sandbox Code Playgroud)
它的工作原理与我的情况相同。
与正确的:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt
Run Code Online (Sandbox Code Playgroud)
终端在当前文件夹中打开并且可以工作,但在 Bash 中打开,不再有 ZSH。
我将不胜感激你的帮助。
我有一个在多台机器上运行的 C 程序,尽管它在我的 MacBook 上正确编译,但我无法在运行 Ubuntu 18.04 并使用 gcc 的 Linux Windows 子系统上编译该程序。
该程序生成多个线程,当我尝试在 Windows 子系统上编译它时,出现错误undefined reference to `pthread_create。
其他几个问题,例如this、this和this,建议使用-lpthread作为编译器标志来解决问题,但我已经这样做了,并且它在 OSX 上编译得很好,所以我怀疑这个问题可能与我的 WSL 配置有关。
我的生成文件是:
CC = gcc
CCOPTS = -Wall -c -g -ggdb
LINKOPTS = -Wall -g -ggdb -lpthread
all: calc
calc: calc.o smp3_tests.o testrunner.o
$(CC) $(LINKOPTS) -o $@ $^
calc.o: calc.c calc.h
$(CC) $(CCOPTS) -o $@ $<
Run Code Online (Sandbox Code Playgroud)
我将 pthread 标头包含在内#include <pthread.h>,并使用 调用该pthread_create函数pthread_create(&multiplierThread, NULL, …
在 Linux 中使用时man,许多命令都会列出 URL,这些 URL 在某些终端中类似于gnome-terminal或terminator可单击。
例如,man ls显示:
允许单击http://www.gnu.org/software/coreutils。
在 WSL 下的Gnome 终结者中单击它会使其挂起。
并在启动 terminator 的终端中显示此输出:
etomort@ES-00002604:/mnt/c/Users/etomort
$ /usr/bin/xdg-open: 782: /usr/bin/xdg-open: : Permission denied
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: x-www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: firefox: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 Windows 内的 .bat 文件执行 ubuntu 内的 .sh 文件。
我尝试过以下代码
cd "C:\Program Files\Ubuntu\Ubuntu"
start ubuntu1804.exe run ErpStartupService.sh
Run Code Online (Sandbox Code Playgroud)
我的 ErpStartupService.sh 是
#!/bin/bash
sudo service mysql start
sudo service nginx start
sudo service redis-server start
sudo service supervisor start
cd /home/frappe/frappe-bench
sudo bench start
read -p "$*"
Run Code Online (Sandbox Code Playgroud)
如果我从 ubuntu 终端运行 ErpStartupService.sh 作为 ./ErpStartupService.sh ,一切都会按预期执行。但是如果我运行 bat 文件终端就会消失并且无法理解发生了什么。我正在使用 ubuntu 18.0.4 作为 wsl
如何从当前使用以下命令删除日志的文件夹和子文件夹中删除文件,但我想删除 Linux 中文件夹和子文件夹中的日志文件。
目前我正在输入每个文件夹并删除特定年份的日志。有没有命令可以从Linux中的文件夹和子文件夹中删除相同的文件
volumes/abc/http.log2019-07-09
volumes/cdf/http.log2019-07-09
Run Code Online (Sandbox Code Playgroud)
我想要一个命令来删除 Linux 中所有文件夹的文件
目前使用以下命令删除文件
sudo rm http.log2019*
Run Code Online (Sandbox Code Playgroud) linux docker superuser docker-volume windows-subsystem-for-linux
从 Git Repo(Bitbucket 和我的 Web 主机)推送和获取在 WSL 上停止工作。我发现通过 ssh 连接在 shell 提示符出现之前挂起。使用ssh -vvv显示了这一点(我删除了我认为不重要的东西):
debug1: Authentication succeeded (publickey).
Authenticated to XXX.XXXX ([XXX.XXX.XXX.XXX]:XX).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: open confirm rwindow 0 rmax 32768
Run Code Online (Sandbox Code Playgroud)
悬挂之前显示的上述内容的数量有所不同。这是有效的,但停止了。我已经更改了 ISP 和路由器(我已经从 ADSL 更改为 NBN),我认为这是原因,但我可以使用 PowerShell (使用 OpenSSH )连接到同一服务器。我尝试过创建新密钥,但得到了相同的结果。我只需要一些有关如何解决此问题的帮助。
我正在 WSL 2 上运行 Ubuntu 18.04.3 LTS(Windows Build 18999,我已经进入内部快速通道尝试修复,也无法在慢速通道上工作)。我在 WSL 上运行 OpenSSH_7.6p1 Ubuntu-4ubuntu0.3、OpenSSL 1.0.2n;以及 PowerShell 上的 OpenSSH_for_Windows_7.7p1、LibreSSL 2.6.5。
我想在使用 WSL2 的 vscode 中使用类似oh-my-bash 的东西。但是根据文档:
在 WSL 中启动 VS Code Remote 时,不会运行任何 shell 启动脚本。这样做是为了避免针对 shell 调整的启动脚本出现问题。如果您想运行其他命令或修改环境,可以在设置脚本中完成
~/.vscode-server/server-env-setup(内部人士~/.vscode-server-insiders/server-env-setup:)。如果存在,则在服务器启动之前处理该脚本。
我添加了一个~/.vscode-server/server-env-setup,根据日志发现并执行了它,但我的 Linux 技能非常基础,我不知道如何安装我的配置文件。我努力了
bash ~/.profile
Run Code Online (Sandbox Code Playgroud)
……但这似乎没有任何作用。我也尝试过
#!/bin/bash
source ~/.profile
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误/mnt/c/Users/cber/.vscode/extensions/ms-vscode-remote.remote-wsl-0.40.3/scripts/wslServer.sh: 3: /home/cber/.vscode-server/server-env-setup: source: not found
更新
下面回答了如何获取配置文件的问题,但我在 WSL2 上的 vs-code 中使用powerline-go 的问题仍然存在,但我将其移至一个新问题以结束此问题。
我使用--import旧的 wsl tar 包来设置 wsl,命令如下:
wsl --import ubuntu1804 c:\WSL c:\temp\ubuntu1804.tar
除了 wsl 的默认用户是 root 之外,它工作正常。我从https://learn.microsoft.com/en-us/windows/wsl/收到帮助消息,
建议使用类似ubuntu configor ubuntu18.04 config... 的命令,但由于我使用“导入”模式设置 wsl,因此没有“我的系统中的 t ubuntu* 二进制文件
你知道如何更改wsl的默认用户吗?
sh: 39: unzip: not found我在 Windows Subsystem For Linux(WSL) 上安装 Deno 时收到以下错误。
windows-subsystem-for-linux ×10
bash ×3
ubuntu ×3
ubuntu-18.04 ×2
batch-file ×1
c ×1
conemu ×1
deno ×1
docker ×1
erpnext ×1
gcc ×1
git ×1
installation ×1
linux ×1
openssh ×1
ros ×1
ssh ×1
superuser ×1
xdgutils ×1