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-222019

S.I.'s questions

Martin Hope
S.I.
Asked: 2018-11-15 01:49:43 +0800 CST

使用 sox 将 .gsm 转换为 .wav

  • 1

我正在尝试将一个格式的音乐文件转换.gsm为 format .wav。这就是我尝试的方式:

for f in *.gsm; do sox $f new/${f%.wav}; done

结果是我在目录中得到了相同格式的相同.gsm文件new/。

谁能指出这里的问题是什么?

codecs convert sox wav
  • 1 个回答
  • 1753 Views
Martin Hope
S.I.
Asked: 2016-11-23 22:35:09 +0800 CST

无法在 ubuntu 16 上安装 mysql-server/client

  • 13

我在安装 mysql 时遇到问题,我无法单独解决。首先,我尝试使用此命令删除和清除旧文件

sudo apt-get remove --purge mysql

也试过

sudo apt-get remove --purge mysql*

和

sudo apt-get remove --purge mariadb*

所有 3 个命令都返回相同的输出...

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
dbconfig-mysql : Depends: mysql-client but it is not going to be installed or
                       mariadb-client but it is not going to be installed or
                       virtual-mysql-client
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

所以我运行建议我的东西apt-get -f install,我得到了

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  mysql-server-5.7
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2,597 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 300885 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb ...
Aborting downgrade from (at least) 10.0 to 5.7.
If are sure you want to downgrade to 5.7, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行时得到的输出相同apt upgrade -f。这是的输出systemctl status mysql.service -l

$ systemctl status mysql.service -l
    ● mysql.service
       Loaded: not-found (Reason: No such file or directory)
       Active: failed (Result: exit-code) since Wed 2016-11-23 07:32:55 EET; 58min ago

    Nov 23 07:32:24 stan systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
    Nov 23 07:32:24 stan mysql[7818]:  * Starting MariaDB database server mysqld
    Nov 23 07:32:55 stan mysql[7818]:    ...fail!
    Nov 23 07:32:55 stan systemd[1]: mysql.service: Control process exited, code=exited status=1
    Nov 23 07:32:55 stan systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
    Nov 23 07:32:55 stan systemd[1]: mysql.service: Unit entered failed state.
    Nov 23 07:32:55 stan systemd[1]: mysql.service: Failed with result 'exit-code'.

我尝试过的另一件事是删除mysql-server然后再次安装它仍然是同样的错误。

任何人都可以帮助解决这个问题。我不知道如何解决它。

更新输出lsb_release -a

$ lsb_release -a
  No LSB modules are available.
  Distributor ID:   Ubuntu
  Description:  Ubuntu 16.04.1 LTS
  Release:  16.04
  Codename: xenial 

更新2:输出sudo apt install mysql-server mysql-client

$ sudo apt install mysql-server mysql-client
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  mysql-client is already the newest version (5.7.16-0ubuntu0.16.04.1).
  mysql-server is already the newest version (5.7.16-0ubuntu0.16.04.1).
  You might want to run 'apt-get -f install' to correct these:
  The following packages have unmet dependencies:
  mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
  E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
server
  • 2 个回答
  • 48620 Views
Martin Hope
S.I.
Asked: 2016-10-21 21:29:47 +0800 CST

Cron 已执行,但脚本不起作用

  • 4

我知道有很多类似的问题,我已经尝试了很多东西,但仍然无法让它发挥作用。

我有计划在 10 分钟运行的 cronjob。我可以看到/var/log/syslog它运行正常

Oct 21 07:30:01 stan CRON[7604]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 07:40:01 stan CRON[8304]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 07:50:01 stan CRON[8751]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 08:00:01 stan CRON[9347]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 08:10:01 stan CRON[9789]: (stan) CMD (stan /home/stan/update.sh)

update.sh调用php更新数据库的脚本。当我直接从终端运行时,shell 脚本数据库已更新并且运行良好

./update.sh

但是来自 cronjob 不会更新数据库。我的 cron

*/10 * * * * stan /home/stan/update.sh

从 shell 脚本产生的命令是

/usr/bin/php /var/www/html/site/update.php

两个文件的权限

-rwxrwxr-x  1 stan stan    123 Oct 20 15:09 update.sh
-rwxr-xr-x  1 stan www-data 1301 Oct 21 07:52 /var/www/html/site/update.php

知道可能是什么问题吗?

更新:路径

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

update.sh

$ cat update.sh 
#!/bin/sh

list="/var/www/html/site"
config="/usr/bin/php"

for i in "$list"
do
    "$config" "$i"/update.php
done

参考我昨天关于 shell 的问题,现在 php 是关于 cron 的。

$ whereis php

php: /usr/bin/php5.6 /usr/bin/php /usr/lib/php /etc/php /usr/include/php /usr/share/php5.6-intl /usr/share/php7.0-mbstring /usr/share/php7.0-common /usr/share/php5.6-curl /usr/share/php5.6-gd /usr/share/php5.6-mcrypt /usr/share/php5.6-common /usr/share/php5.6-readline /usr/share/php5.6-json /usr/share/php /usr/share/php5.5-mbstring /usr/share/php5.6-opcache /usr/share/php5.6-mbstring /usr/share/php5.6-xml /usr/share/php5.5-common /usr/share/php5.6-mysql /usr/share/man/man1/php.1.gz

$ which php
/usr/bin/php
scripts
  • 3 个回答
  • 4048 Views
Martin Hope
S.I.
Asked: 2016-10-20 21:56:30 +0800 CST

从 shell 脚本调用和运行 php 脚本

  • 7

我正在尝试一些简单但无法弄清楚的事情。尝试运行一个从站点目录调用 php 脚本的 shell 脚本。我的 shell 脚本很简单test.sh:

#!/bin/sh

LIST="/path/to/my/site/dir"
CONFIG="/usr/bin/php "

for i in $LIST
do
    . "${CONFIG}${i}/test.php"        
done

我test.php没有错误,当我直接在浏览器中运行它时它正在工作。它再次简单的脚本,如

<?php
  // source code
?>

当我运行./test.sh结果是

./test.sh: 8: .: 无法打开 /usr/bin/php /path/to/my/site/dir/test.php

8号线是. "${CONFIG}${i}/test.php"

我也尝试在 PHP 文件的开头添加这一行,但结果是一样的

#!/usr/bin/php

更新:php的路径

$ which -a php
/usr/bin/php

我也做过chmod +x test.php

bash
  • 3 个回答
  • 36993 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