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
    • 最新
    • 标签
主页 / user-327946

Carol.Kar's questions

Martin Hope
Carol.Kar
Asked: 2022-01-01 08:03:03 +0800 CST

由于未满足依赖关系,无法创建 venv

  • 1

我在 VirtualBox 上运行Ubuntu 18.04.5 LTS。我正在跑步Python 3.6.9。

尝试创建虚拟环境时,sudo python3 -m venv env我得到:

admin@admin-VirtualBox:~/Desktop/project$ sudo python3 -m venv .venv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/admin/Desktop/project/.venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

admin@admin-VirtualBox:~/Desktop/project$ python3 --version
Python 3.6.9
admin@admin-VirtualBox:~/Desktop/project$ sudo apt-get install python3.6-venv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3.6-venv : Depends: python3.6 (= 3.6.5-3) but 3.6.9-1~18.04ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.
admin@admin-VirtualBox:~/Desktop/project$ 

我研究并发现python3已经venv预装了。我相信有一些破碎的依赖关系。

我试过了:

admin@admin-VirtualBox:~/Desktop/project$ sudo apt-cache policy python3.6-venv python3.6 python3
python3.6-venv:
  Installed: (none)
  Candidate: 3.6.5-3
  Version table:
     3.6.5-3 500
        500 http://at.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
python3.6:
  Installed: 3.6.9-1~18.04ubuntu1.1
  Candidate: 3.6.9-1~18.04ubuntu1.1
  Version table:
 *** 3.6.9-1~18.04ubuntu1.1 100
        100 /var/lib/dpkg/status
     3.6.5-3 500
        500 http://at.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
python3:
  Installed: 3.6.7-1~18.04
  Candidate: 3.6.7-1~18.04
  Version table:
 *** 3.6.7-1~18.04 100
        100 /var/lib/dpkg/status
     3.6.5-3 500
        500 http://at.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

任何建议如何解决这个问题?问题是什么?

感谢您的回复!

18.04
  • 1 个回答
  • 273 Views
Martin Hope
Carol.Kar
Asked: 2021-10-19 11:31:10 +0800 CST

将文件拆分为多个子文件夹并压缩每个子文件夹

  • 0

我正在使用Ubuntu 18.04.5 LTS.

我创建了以下脚本来将文件夹中的文件拆分为不同的子文件夹:

#!/bin/bash

dir_size=850
dir_name="images"
n=$((`find . -maxdepth 1 -type f | wc -l`/$dir_size+1))
for i in `seq 1 $n`;
do
    mkdir -p "$dir_name$i";
    find . -maxdepth 1 -type f | head -n $dir_size | xargs -i mv "{}" "$dir_name$i"
done

但是,我想zip在创建后每个子文件夹,这样我只能在我的最终目录中获得压缩的子文件夹。

任何建议如何做到这一点?

感谢您的回复!

command-line
  • 1 个回答
  • 160 Views
Martin Hope
Carol.Kar
Asked: 2021-02-28 09:38:07 +0800 CST

ssh 隧道 - 绑定:地址已在使用中

  • 0

我在我的 VPSUbuntu 20.04.1 LTS和本地运行Ubuntu 18.04.3 LTS,我想创建一个 ssh 隧道来连接到我的数据库以SELECT在我的应用程序中运行以进行报告laravel 6。

我的生产数据库在我的服务器上具有以下凭据:

DB_HOST_PROD=127.0.0.1
DB_PORT_PROD=3306
DB_DATABASE_PROD=test_db
DB_USERNAME_PROD=root
DB_PASSWORD_PROD=prod_pwd

运行时我ssh-command得到:

admin@admin-VirtualBox:~$ /usr/bin/ssh -o StrictHostKeyChecking=no -v -N -i /home/admin/.ssh/id_rsa -L 13307:127.0.0.1:3306 -p 22 [email protected]
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xx.xx.xxx.xx [xx.xx.xxx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/admin/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/admin/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to xx.xx.xxx.xx:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:aaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaa
debug1: Host 'xx.xx.xxx.xx' is known and matches the ECDSA host key.
debug1: Found key in /home/admin/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /home/admin/.ssh/id_rsa
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug1: Authentication succeeded (publickey).
Authenticated to xx.xx.xxx.xx ([xx.xx.xxx.xx]:22).
debug1: Local connections to LOCALHOST:13307 forwarded to remote address 127.0.0.1:3306
debug1: Local forwarding listening on ::1 port 13307.
bind: Address already in use
debug1: Local forwarding listening on 127.0.0.1 port 13307.
bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 13307
Could not request local forwarding.
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Remote: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding

我在本地运行我的开发数据库:

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=test_db
DB_USERNAME=root
DB_PASSWORD=local_pwd

为什么我会收到消息bind: Address already in use?

有什么建议我做错了吗?

server
  • 1 个回答
  • 3005 Views
Martin Hope
Carol.Kar
Asked: 2021-02-22 00:31:09 +0800 CST

从控制台启动 dbeaver

  • 1

我正在使用Ubuntu 18.04.3 LTS并且已经安装dbeaver:

sudo add-apt-repository ppa:serge-rider/dbeaver-ce
sudo apt-get install dbeaver-ce

我有一个setupDevEnvironment脚本,我想从控制台启动 dbeaver,但还没有找到方法。

任何建议如何做到这一点?

感谢您的回复!

command-line
  • 2 个回答
  • 6557 Views
Martin Hope
Carol.Kar
Asked: 2020-04-04 12:09:14 +0800 CST

运行生成多个终端的 .sh 脚本

  • 0

我正在使用Ubuntu 18.04.3 LTS.

目前要启动我的开发环境,我必须在终端中运行以下每个命令:

sudo systemctl stop apache2

sudo /opt/lampp/manager-linux-x64.run

sudo /opt/PhpStorm-193.6015.48/bin/phpstorm.sh 

sudo chmod -R 777 Desktop/Code/testProject

我想双击我桌面上的脚本并自动生成需要在后台运行的两个终端lampp和phpstorm

但是,当当前执行脚本时,它只启动lampp-server。

有什么建议我做错了吗?

感谢您的回复!

command-line bash
  • 1 个回答
  • 1481 Views
Martin Hope
Carol.Kar
Asked: 2020-02-05 22:57:26 +0800 CST

仅使用来自 xampp 的 php

  • 0

我正在使用Ubuntu 18.04.3 LTS和。xamppphp 7.4

我正在尝试更改> php路径变量。

我试过了:

admin@admin:/opt/lampp/bin$ sudo ln -s /opt/lampp/bin/php /usr/bin/php
admin@admin:/opt/lampp/bin$ which php
/usr/bin/php

如您所见,我的路径变量似乎在/usr/bin/php.

  1. 如何检查当前路径变量php?
  2. 如何将xampp'sphp 可执行文件设置为PATH变量?

感谢您的回复!

php lamp xampp 18.04
  • 2 个回答
  • 2113 Views

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