标签: debian

E:无法找到包裹npm

当我尝试安装npm时sudo apt-get install npm,我收到以下错误:

E:无法找到包裹npm

为什么不能找到npm?我正在使用Debian 9 sudo apt-get install nodejs.

debian apt apt-get node.js npm

51
推荐指数
5
解决办法
6万
查看次数

Postgres 15. 模式公共权限被拒绝

无法以非超级用户身份在公共架构中创建表

postgres - 超级用户。

我做了什么:

ALTER SCHEMA public owner to postgres;  

CREATE USER admin WITH PASSWORD 'my-password';   

GRANT USAGE, CREATE ON SCHEMA public TO postgres;   
GRANT USAGE, CREATE ON SCHEMA public TO admin;    

CREATE DATABASE mydb;    
GRANT ALL ON DATABASE mydb TO admin;
Run Code Online (Sandbox Code Playgroud)

特权:

postgres=# \dn+
                          List of schemas
  Name  |  Owner   |  Access privileges   |      Description       
--------+----------+----------------------+------------------------
 public | postgres | postgres=UC/postgres+| standard public schema
        |          | =UC/postgres        +| 
        |          | admin=UC/postgres    | 
(1 row)
Run Code Online (Sandbox Code Playgroud)

我得到了什么:

在此输入图像描述

如何在公共模式中创建表?

sql postgresql debian postgresql-15

51
推荐指数
1
解决办法
5万
查看次数

优化PDF文件(使用Ghostscript或其他)

如果要优化PDF文件并减小文件大小,Ghostscript是最佳选择吗?

我需要存储很多PDF文件,因此我需要尽可能地优化和减小文件大小

有没有人有Ghostscript和/或其他的经验?

命令行

exec('gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
-dPDFSETTINGS=/screen -sOutputFile='.$file_new.' '.$file);
Run Code Online (Sandbox Code Playgroud)

linux pdf debian ghostscript

49
推荐指数
4
解决办法
6万
查看次数

Ubuntu上的nginx:权限被拒绝

我是系统管理的新手.在Ubuntu上通过puppet安装nginx后,我得到以下输出:

[alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)

[warn] 1898#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1

[emerg] 1898#0: open() "/var/log/nginx/access.log" failed (13: Permission denied)
Run Code Online (Sandbox Code Playgroud)

如何摆脱所有这些消息?

我不想直接使用命令行(chown/chmod)并在每次创建新服务器时重复它.因此,我在考虑必须添加到木偶清单中的内容.

在这种情况下,最好的系统管理员做法是什么:更改/ var/log/nginx的所有者/权限或将日志存储在不同的位置?如果chown/chmod是要走的路,哪些特定权限可以确保最高级别的安全性?

我尝试了这个,但它没有帮助:

  file { '/var/log/nginx':
    ensure  => directory,
    mode    => '0755',
    owner   => 'www-data',
    group   => 'www-data',
    recurse => true
  }
Run Code Online (Sandbox Code Playgroud)

编辑:

vagrant@precise64:~$ ps aux | grep [n]ginx
root      1001  0.0  0.1  62908  1388 …
Run Code Online (Sandbox Code Playgroud)

ubuntu debian nginx puppet vagrant

49
推荐指数
6
解决办法
10万
查看次数

升级到php-7后"调用未定义的函数mysql_connect()"

在我将php5升级到php7之后,我收到错误500

PHP致命错误:未捕获错误:调用未定义函数mysql_connect()

我把它放到我的apt源码中以便立即获得php7:

deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all

我基本上做的是:

apt-get remove php5
apt-get install php7-*
Run Code Online (Sandbox Code Playgroud)

我正在使用当前版本的Debian Jessie.

但我仍然得到这个.这里有很多关于SO的问题我绝对检查过它们.但我还没有找到答案.

php debian php-7

48
推荐指数
1
解决办法
18万
查看次数

RabbitMQ(beam.smp)和高CPU /内存负载问题

我有一个debian盒用芹菜和rabbitmq运行任务大约一年.最近我注意到任务没有被处理,所以我登录系统,发现芹菜无法连接到rabbitmq.我重新启动了rabbitmq-server,尽管芹菜不再抱怨它现在没有执行新的任务.奇怪的是,rabbitmq正在疯狂地吞噬cpu和内存资源.重新启动服务器无法解决问题.花了几个小时在网上寻找解决方案后无济于事我决定重建服务器.

我用Debian 7.5,rabbitmq 2.8.4,芹菜3.1.13(Cipater)重建了新的服务器.大约一个小时左右,一切都工作得很好,直到芹菜开始再次抱怨它无法连接到rabbitmq!

[2014-08-06 05:17:21,036: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
Trying again in 6.00 seconds...
Run Code Online (Sandbox Code Playgroud)

我重新启动了rabbitmq service rabbitmq-server start和同样的问题:

rabbitmq开始再次膨胀,不断冲击cpu并慢慢接管所有ram并交换:

PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
21823 rabbitmq  20   0  908m 488m 3900 S 731.2 49.4   9:44.74 beam.smp
Run Code Online (Sandbox Code Playgroud)

结果rabbitmqctl status如下:

Status of node 'rabbit@li370-61' ...
[{pid,21823},
 {running_applications,[{rabbit,"RabbitMQ","2.8.4"},
                        {os_mon,"CPO  CXC 138 46","2.2.9"},
                        {sasl,"SASL  CXC 138 11","2.2.1"},
                        {mnesia,"MNESIA  CXC 138 12","4.7"},
                        {stdlib,"ERTS  CXC 138 10","1.18.1"},
                        {kernel,"ERTS  CXC …
Run Code Online (Sandbox Code Playgroud)

erlang debian mnesia rabbitmq celery

47
推荐指数
2
解决办法
7万
查看次数

存储库“http://security.debian.org/debian-security buster/updates InRelease”将其“Suite”值从“stable”更改为“oldstable”

我的一些 Github Actions 工作流最近开始在安装 Chromedriver 时返回此错误:

Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Reading package lists...
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
Error: Process completed with exit code 100.
Run Code Online (Sandbox Code Playgroud)

这是我的步骤实现:

Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB] …
Run Code Online (Sandbox Code Playgroud)

shell debian selenium-chromedriver debian-buster github-actions

47
推荐指数
3
解决办法
1万
查看次数

如何对Python包进行Debian打包?

我需要编写或找到一个脚本来使用Python包中的python-support创建Debian包.Python包将是纯Python,没有C扩展.

用于测试目的的Python包只是一个包含空python-support文件和单个Python模块的目录__init__.py.

打包脚本必须使用python-support为目标平台上可能的多个Python安装提供正确的字节码,即Ubuntu Jaunty上的v2.5和v2.6.

我在谷歌搜索时发现的大多数建议只是讨厌的黑客的例子,甚至不使用python-support或python-central.

我花了几个小时研究这个,我能想到的最好的是从现有的开源项目中破解脚本,但我不知道我正在做什么需要哪些位.

有没有人以合理的非hacky方式从Python包中制作Debian软件包?

我开始认为,从不知道Debian打包和python支持到获得工作脚本需要一个多星期的时间.其他人需要多长时间?

python debian

46
推荐指数
5
解决办法
2万
查看次数

Windows10 WSL2 Ubuntu / Debian # 无网络

从 WSL 升级到 WSL2 后

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

不再起作用。后:

wsl --set-version Ubuntu-18.04 2

输出是:

> sudo apt-get update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving …
Run Code Online (Sandbox Code Playgroud)

ubuntu debian apt windows-subsystem-for-linux wsl-2

45
推荐指数
6
解决办法
4万
查看次数

在Ubuntu上使用shell脚本附加到crontab

我正在尝试在Ubuntu上的crontab中添加一行.

现在,我正在crontab -e那里编辑crontab.

但是,我似乎无法找到真正的crontab文件,因为crontab -e似乎给你一个临时的工作副本.

/etc/crontab 看起来像系统crontab.

crontab -e保存到的crontab的路径是什么?

谢谢!

ubuntu cron debian crontab

44
推荐指数
3
解决办法
3万
查看次数