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

mike rodent's questions

Martin Hope
mike rodent
Asked: 2024-02-01 18:50:33 +0800 CST

将“bash find”中的文件添加到 7z 存档中

  • 5

在问这个之前我做了很多搜索!(即便如此,我还是希望有人指出重复的内容)。

所以我收集了一堆文件,例如:

find . -name "2020-*" 

...是否有某种方法可以将所有这些文件“管道”到 .7z 存档中?(注意,我意识到“管道”可能不是正确的词,因为我想要的操作实际上是文件复制操作)。

我尝试过类似的事情:

find . -name "2020-*" | 7z a -p pumple.7z

...这给了我下一行“>”,就好像它期待一些控制台输入一样。

以下内容也是如此:

 find . -name "2020-* > 7z a -p pumple.7z
bash
  • 1 个回答
  • 29 Views
Martin Hope
mike rodent
Asked: 2020-01-18 04:27:51 +0800 CST

logrotate 是如何工作的?

  • 6

我真的很难理解logrotate在我自己的 shell 文件中运行命令时是如何工作的,以及它是如何不工作的。

有问题的命令是:

rclone -L -vv --log-file "/home/mike/tmp/qqq.log"  sync "/media/mike/W10 D drive/My Documents/"  remote:MyDocuments_M17A_from_Linux

我想要什么:

我希望经常检查这个 qqq.log 文件,比如每 10 分钟一次,看看它是否超过了给定的大小,比如 1 MB。如果有,旋转文件。rclone使用该-vv选项会故意产生丰富的输出(即试图理解让 logrotate 为这个用例工作)。

这里有一个适度有用的教程,但它仍然让我一无所知:

  1. 您打算如何配置来自您自己的非系统进程的日志轮换?您是要在底部粘贴线条/etc/logrotate.conf吗?这就是我所做的(在“#system-specific logs may be configured here”下):

    /home/mike/tmp/qqq.log {
      notifempty
      size 1M
      daily
      create 0664 root root
      rotate 3
    }
    

    后来:我现在意识到您也可以将单个文件放入/etc/logrotate.d其中-那里没有太大的复杂性。

  2. 是不是默认情况下logrotate每天只运行一次,凭借文件/etc/cron.daily/logrotate?

  3. 这是否意味着如果我想要更频繁的检查,我可能应该设置一个cron工作来执行此操作,每 10 分钟运行一次(在此示例中)?

  4. 你打算以logrotate <config file>root身份运行吗?我问这个问题是因为我以 root 和用户身份都尝试过。用户似乎没有工作。

指向此类设置的初学者指南的链接(这种设置并不少见)会很有帮助。我已经搜索过,但我发现的大部分内容都没有为您提供分步指南。

logs logrotate
  • 2 个回答
  • 4896 Views
Martin Hope
mike rodent
Asked: 2020-01-08 12:08:23 +0800 CST

与Linux混淆查找正则表达式

  • 1

我对 Linuxfind命令的正则表达式用法感到很困惑。

我知道有一个 option regextype,但是没有那个,根据当前的手册页,它应该使用 Emacs 正则表达式。 这个页面似乎说支持字符类(“这是一个 POSIX 功能”),但我的实验似乎表明没有任何东西像或[[:ascii:]]永远不会起作用,除了这些是处理字符类的真正古老方法这一事实之外。相反,您似乎必须使用它,除了其他任何东西之外,它对于 Unicode 字符是无用的。[[:digit:]][[:alnum:]][a-zA-Z]

所以我转向regextype:我发现你可以通过去获得一个可能的设置列表find -regextype help。这给出了:

find: Unknown regular expression type ‘help’; valid types are ‘findutils-default’, ‘awk’, ‘egrep’, ‘ed’, ‘emacs’, ‘gnu-awk’, ‘grep’, ‘posix-awk’, ‘posix-basic’, ‘posix-egrep’, ‘posix-extended’, ‘posix-minimal-basic’, ‘sed’.

...所以我假设通过包含-regextype posix-basic,例如,我可以运行这样的东西:

find . -maxdepth 1 -regextype posix-basic -regex .*\d.*

这会产生结果,但不是我希望的结果:当前目录中的所有文件和文件夹的名称都带有小写字母“d”!我期待所有名称至少有一个数字。

我find在 Stack Exchange 上查看了很多 Linux 正则表达式问题,但我认为我没有看到一个展示“现代”字符类处理的问题。是否有任何regextype选项能够处理这样的事情:

find . -maxdepth 1 -regextype ??? -regex '.*\d{3}\s+.*'

我的意思是“包含三位数字,后跟一个或多个空格字符”。即像 Java、Python、Javascript 等普通语言的正则表达式规则之类的东西......?

后来,以下评论

这是一个练习:创建一个目录并将一些随机名称的文件放入其中。然后添加具有以下名称的文件:“ctb117b”、“ctb117c”、“trt117a”。

然后我想隔离“117”文件。可能有名为“xxx0009333qqq”的文件。因此,例如,使用现代正则表达式引擎我会这样(允许前面的 ./):

find . -regex './\w{3}\d\{3}.*' 

使用这些更古老的 Linux 正则表达式规则,我该怎么做?

find . -regextype posix-basic -regex '.*[[:digit:]]{3}.*' 

什么都不生产。'.*[[:digit:]]+.*'例如,也没有。如果有人有足够的兴趣,请给我看一些对你有用的东西(列出上面的文件)。

regular-expression find
  • 1 个回答
  • 1244 Views
Martin Hope
mike rodent
Asked: 2020-01-06 09:50:56 +0800 CST

使用 Timeshift 或类似方法来同步/备份任意位置?

  • 2

我已经使用双启动机器几年了。我已经到了将 95% 的时间花在登录 Linux 而不是专有操作系统 (W10) 上的地步,因此我需要为我的备份和同步安排选择一个基于 Linux 的主力应用程序。

我已经使用 Timeshift 几个月了,并且不得不“愤怒地”使用它 3 或 4 次,通常是由于我的一些愚蠢行为。我是它的程序化“快照”的忠实粉丝:可能你可以回顾几个月并找到一个很久以前删除的文件,然后恢复它。然而,由于它以增量方式执行这些快照,因此它们不会占用大量空间。

我不明白为什么 Timeshift 被设计为(据我所知)只同步“我的系统”或“我的系统和我的主目录”......就是这样。在一个理想的世界中,我想使用 Timeshift 来完成我所有的备份/同步任务……例如,包括针对不同工作的不同过滤。

我没有发现任何迹象表明任何人能够(或希望)调整 Timeshift 以实现更通用的用途。既然如此,在做快照等方面,哪个 FOSS Linux 备份应用程序最像 Timeshift,但也更自由地配置?

PS我今天一直在研究rsnapshot,一个基本上位于顶部rsync并实现快照安排的应用程序。使用它完成了第一次同步备份后,我认为它对我来说可能有点过于复杂,并且没有充分记录我的需求。这里有一些有趣的技术批评可能(仍然是?)有效。显然它是用 PERL(!) 编写的。我有一半倾向于编写一个使用调用来组织事物的 Python 脚本rsync:至少我知道它在做什么。我在很多系统管理任务中都使用了这样的 Python 脚本。

O 表示 Timeshift 的简单性。

backup synchronization
  • 1 个回答
  • 79 Views
Martin Hope
mike rodent
Asked: 2020-01-02 00:41:17 +0800 CST

更新 Linux 应用程序 (rsync) - 我打算如何处理 .yo 文件?

  • 0

操作系统:Linux Mint 18.3

为了开始使用,rsync我想升级到最新版本:这台机器上的 Synaptic 有 3.1.1 版本。但最新的稳定版本是 3.1.3。

所以我下载了源文件并编译。我还被告知要获得最新的man页面,我必须安装 yodl,我也安装了。

之后make(注意,我以前从未这样做过安装或更新应用程序)我发现rsync“扩展”目录中有一个可执行文件(是的,版本确实是 3.1.3)和两个 .yo 文件:rsync。哟和 rsyncd.conf.yo。

我想现在要做的就是rsync用新的rsync.

但是我打算如何处理这些 .yo 文件以确保这些man页面将提供有关 3.1.3 版本而不是 3.1.1 版本的说明?

upgrade man
  • 1 个回答
  • 419 Views
Martin Hope
mike rodent
Asked: 2019-12-02 04:01:35 +0800 CST

VPS 自动补全的问题

  • 1

我刚刚使用hostinger.com 设置了一个VPS。操作系统是 Ubuntu 18.04。我创建了一个用户帐户,迈克。我很快意识到自动完成功能显然没有安装,所以查看了你是如何做到这一点的。出于某种原因(外壳类型?)我必须使用点而不是单词来获取源source。

以 mike 身份登录,我这样做了:

sudo apt-get install bash-completion

(NB试图解决我后来尝试的问题sudo apt-get install --reinstall bash-completion)

...我将此行添加到/home/mike/.bashrc:

. /etc/bash_completion

事实上,这个文件由一行组成:

. /usr/share/bash-completion/bash_completion

目前的情况是,当我以 root 身份登录时,我可以通过执行以下操作获得自动完成功能:

$ . /home/mike/.bashrc

但是当以 mike 身份登录时,相同的命令给出:

$ . /home/mike/.bashrc
-su: 26: /usr/share/bash-completion/bash_completion: Syntax error: "(" unexpected

搜索答案我推测问题可能是由别名冲突引起的。但是现在以 mike 身份登录时没有别名,但问题仍然存在。

我正在尝试(除其他外)了解“-su:26”的实际含义。这似乎是一个行参考。但该文件的第 26 行实际上是空白的。

我现在想做的是通过/usr/share/bash-completion/bash_completion,注释掉行,直到事情开始变得有意义。但这是一个大文件!

显然,其中一个奇怪的方面是它在我以 root 身份登录时有效,但在以 mike 身份登录时无效。

后来
我scp把我本地机器上的 bash_completion 文件放到了 VPS 上,并用它来替换现有的文件(先重命名后者)。同样,在 root 工作正常时进行采购。同样,以 mike 身份登录时进行采购会产生(几个)错误:

$ . /home/mike/.bashrc
-su: 29: /usr/share/bash-completion/bash_completion: [[: not found
-su: 35: /usr/share/bash-completion/bash_completion: [[: not found
-su: 51: /usr/share/bash-completion/bash_completion: shopt: not found
-su: 57: /usr/share/bash-completion/bash_completion: complete: not found
-su: 62: /usr/share/bash-completion/bash_completion: complete: not found
[... more... ]

有什么建议么?可能是迈克帐户出于某种原因使用了不同的外壳?不同的shell语法?我该如何检查这种事情?

autocomplete not-root-user
  • 1 个回答
  • 291 Views
Martin Hope
mike rodent
Asked: 2019-10-08 08:30:00 +0800 CST

sudo apt-get update 错误:如何清理我的 MariaDB 安装?

  • 2

Linux Mint 18.3(基于 Ubuntu Xenial)。

我在这里查看了其他问题,但我仍然不知道从哪里开始清理我的包列表,特别是 MariaDB。任何指向我可以阅读更多关于管理这些列表以及它们的注意事项和注意事项的链接都会很好。

特别是我想从下面的输出中知道一件事:我应该如何处理我的 MariaDB (MySQL) 安装?

当我尝试找出我的 mysql 和 mysqld 版本时,我得到以下信息

mikeM17A ~ $  mysql --version
mysql  Ver 15.1 Distrib 10.2.16-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
mike@M17A ~ $  mysqld --version
mysqld  Ver 10.2.16-MariaDB-10.2.16+maria~xenial for debian-linux-gnu on x86_64 (mariadb.org binary distribution)

在 /etc/apt/sources.list.d/ 我有两个似乎与这个 MySQL 问题有关的文件:MariaDB101.list 和 MariaDB102.list。例如,后者只包含一行:

deb https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena main

是删除这些的想法吗?然后我应该安装 Synaptic (10.2.27) 中可用的 MariaDB 吗?麻烦的是其中有几十个带有“mariadb”这个词的包......我不知道要安装哪个。

如果我这样做,它们会以某种方式安装“超过”现有的 MariaDB 安装吗?

对此输出的任何其他评论sudo apt-get update将不胜感激。

mike@M17A ~ $  sudo apt-get update
Hit:1 http://ppa.launchpad.net/adabbas/1stppa/ubuntu xenial InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                              
Hit:3 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease                                              
Hit:4 https://deb.nodesource.com/node_10.x xenial InRelease                                                               
Hit:5 http://dl.google.com/linux/chrome/deb stable Release                                                                
Hit:6 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                   
Hit:7 http://ppa.launchpad.net/bit-team/stable/ubuntu xenial InRelease                                                    
Hit:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                                                           
Hit:9 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial InRelease                                                     
Hit:10 http://archive.ubuntu.com/ubuntu xenial-backports InRelease                                                        
Get:12 https://deb.opera.com/opera-stable stable InRelease [2,591 B]                                                      
Hit:13 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease                                                    
Hit:14 http://security.ubuntu.com/ubuntu xenial-security InRelease                                                        
Ign:15 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena InRelease                                              
Ign:16 http://packages.linuxmint.com sylvia InRelease                                                                     
Hit:17 http://ppa.launchpad.net/jeffreyratcliffe/ppa/ubuntu xenial InRelease                                              
Ign:18 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena InRelease                                              
Hit:19 https://dl.winehq.org/wine-builds/ubuntu xenial InRelease                                                          
Ign:20 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release                                                
Hit:21 http://archive.canonical.com/ubuntu xenial InRelease                                                               
Hit:22 http://ppa.launchpad.net/michael-sheldon/deepspeech/ubuntu xenial InRelease                                        
Get:23 http://repository.spotify.com stable InRelease [3,316 B]                                                           
Ign:24 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release                                                
Hit:25 http://ppa.launchpad.net/michael-sheldon/gst-deepspeech/ubuntu xenial InRelease                          
Get:26 http://packages.linuxmint.com sylvia Release [24.2 kB]                                                             
Ign:27 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main amd64 Packages                                    
Hit:28 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease                                              
Ign:29 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main i386 Packages                                     
Hit:30 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial InRelease                                                     
Ign:31 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main all Packages                                      
Ign:32 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en_GB                                 
Hit:33 http://ppa.launchpad.net/qos/pulseaudio-dlna/ubuntu xenial InRelease                                               
Ign:34 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en                                    
Hit:35 http://ppa.launchpad.net/rolfbensch/sane-git/ubuntu xenial InRelease                                               
Ign:36 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages                      
Ign:37 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages                                     
Hit:38 http://ppa.launchpad.net/stefansundin/truecrypt/ubuntu xenial InRelease                                            
Err:12 https://deb.opera.com/opera-stable stable InRelease                                                                
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4B8EC3BAABDC4346
Ign:39 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages                                      
Ign:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB                                 
Hit:41 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu xenial InRelease                                                     
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en                                    
Hit:43 http://ppa.launchpad.net/teejee2008/ppa/ubuntu xenial InRelease                                                    
Get:44 http://packages.linuxmint.com sylvia Release.gpg [819 B]                                                           
Ign:27 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main amd64 Packages                                    
Hit:45 http://ppa.launchpad.net/thomas.tsai/ubuntu-tuxboot/ubuntu xenial InRelease                                        
Ign:29 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main i386 Packages                                     
Ign:31 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main all Packages 
Ign:32 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en_GB
Ign:34 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en
Ign:36 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
Ign:37 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Hit:46 http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.2/ubuntu xenial InRelease
Ign:23 http://repository.spotify.com stable InRelease
Ign:39 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Ign:27 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main amd64 Packages
Ign:29 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main i386 Packages
Ign:31 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main all Packages
Ign:32 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en_GB
Ign:34 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en
Ign:36 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
Ign:37 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Ign:39 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Ign:27 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main amd64 Packages
Ign:29 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main i386 Packages
Ign:31 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main all Packages
Ign:32 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en_GB
Ign:34 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en
Ign:36 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
Ign:37 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Ign:39 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Ign:27 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main amd64 Packages
Ign:29 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main i386 Packages
Ign:31 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main all Packages
Ign:32 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en_GB
Ign:34 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en
Ign:36 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
Ign:37 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Ign:39 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Err:27 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main amd64 Packages
  404  Not Found
Ign:29 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main i386 Packages
Ign:31 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main all Packages
Ign:32 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en_GB
Ign:34 https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena/main Translation-en
Err:36 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
  404  Not Found
Ign:37 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Ign:39 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Fetched 30.9 kB in 2s (14.3 kB/s)
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://deb.opera.com/opera-stable stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4B8EC3BAABDC4346
W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'http://repository.spotify.com stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch https://deb.opera.com/opera-stable/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4B8EC3BAABDC4346
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/additional-repositories.list:2 and /etc/apt/sources.list.d/additional-repositories.list:3
apt
  • 1 个回答
  • 3720 Views
Martin Hope
mike rodent
Asked: 2019-09-26 12:52:13 +0800 CST

如何安装 apt-get/pip 包以供特定 Python 版本使用?

  • 0

操作系统 Linux Mint 18.3。基于 Ubuntu Xenial。

这将“Python 3.5.2”作为其安装版本。我了解到在 Ubuntu 操作系统中尝试升级 Python 并不好,因为它显然是由系统组件使用的。

但是我想使用 Python 3.6,所以我安装了它,如果我想运行它,我可以去Python3.6 xxx. 我还设置了 Eclipse 来使用它。

现在我想使用 PyQT(GUI 模块),所以我发现你去:

sudo apt-get install python-qt4

或者

sudo apt-get install pyqt5-dev-tools

然后,一个测试程序在终端中运行良好(使用“python3 test.py”,即系统的 Python),但当我使用“python3.6 test.py”时失败:这些模块显然不适用于 3.6 版本。它在我将版本设置为 3.6 的 Eclipse 项目中也失败了。

所以我想知道如何安装一个对 3.6 可见的版本。我想知道是否pip可以完成这项工作。所以我去了:

python3.6 -m pip install python-qt4

接着

python3.6 -m pip install pyqt5-dev-tools

这些都失败了,给出了相同的消息(显然替换为“pyqt5-dev-tools”):

mike@M17A ~/software projects/eclipse-workspace/PyLookup2019-09/src/core $  python3.6 -m pip install python-qt4
Collecting python-qt4
  Could not find a version that satisfies the requirement python-qt4 (from versions: )
No matching distribution found for python-qt4  

如何让我的 3.6 版本能够使用 PyQt?

apt
  • 1 个回答
  • 151 Views
Martin Hope
mike rodent
Asked: 2019-09-17 16:11:01 +0800 CST

关于安装和升级应用程序有什么经验法则吗?

  • 0

操作系统:Linux Mint 18.3

我将自己描述为低中级 Linux 用户。

我只花了大约 4 个小时研究如何升级我的 NodeJS 版本。最后,我不得不调整一个被 CURLed 的构建脚本。

我的问题是:在 Linux 操作系统中安装新软件或更新现有软件的推荐方法是什么?

例如,在尝试寻找解决方案的过程中,我发现可以简单地为最新的 NodeJS 版本下载一个 .tar.gz,然后解压……然后配置 PATH 环境变量。这似乎是一种非常简单的做事方式。

但不知何故,这似乎不对:特别是,不是所有的 Linux 应用程序都使用系统中的现有包吗?因此,如果您只是使用一组自包含的可执行文件,这是否意味着您有重复代码、使用过时和未记录的依赖模块等的风险?

安装应用程序时是否还使用其他目录,例如 \opt?我不知道那是什么,但它可能很重要。此外,如果您没有使用列出的存档进行安装,您显然不能通过按一下按钮(apt-get update然后apt-get install X)进行更新。

优先顺序?

  • 第一件事(据我了解)是查看本地 Synaptic 存储库(如果这是正确的话)。但是,如果您想要的东西不存在,或者通常情况下已经过时了怎么办?
  • (在 Linux Mint 中)还有“软件管理器”。我永远不确定这通常与 Synaptic 有何关系。
  • 在此之后有 PPA。它们是否比下载和解压压缩文件(通常是 .tar.gz)低或高?
  • 最后,如果有的话,一个压缩文件。

当您的系统存储库缺少最新版本时,与使用 PPA 相比,简单下载的压缩文件有哪些优缺点?

例如,我收到的错误消息apt-get update似乎表明我当前的 MariaDB 版本完全不正常:来自配置的 PPA 的 404 错误(我想就是这样)。我似乎需要更新或安装新版本。同样,我刚刚从该站点下载了最新的 MariaDB 的 .tar.gz:很容易提取它,并根据需要调整 PATH 变量。

software-installation
  • 1 个回答
  • 51 Views
Martin Hope
mike rodent
Asked: 2019-09-16 16:28:19 +0800 CST

我尝试在 Linux 中安装/升级 Node.JS 出了什么问题?

  • 3

操作系统:Linux Mint 18.3。类似于 Ubuntu。

与 Linux 一样,我真的不知道我打算如何安装软件:

  1. 它已经在系统上了吗?在这种情况下是的,但它很旧:4.2.6。在撰写本文时,当前的 LTS 版本是 10.16.3。
  2. 我应该使用apt吗?
  3. 我应该使用软件管理器吗?
  4. 我应该使用 PPA 吗?
  5. 我应该下载压缩文件并解压缩吗?

来自其他用户的软件管理器评论类似于“去这里获取最新版本”(https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions)

第一个命令是

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

这失败了:

> 
mike@M17A ~ $  curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
[sudo] password for mike: 

## Installing the NodeSource Node.js 10.x repo...


## Populating apt-get cache...

+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease                        
Hit:3 http://dl.google.com/linux/chrome/deb stable Release                     
Hit:4 http://ppa.launchpad.net/adabbas/1stppa/ubuntu xenial InRelease          
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]       
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]     

... // then many messages like this:

Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:43 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:44 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:44 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Fetched 329 kB in 23s (14.0 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch http://repository.spotify.com/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
W: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting

...我不确定所有这些 mariadb 命令的全部内容。我的系统上有 MariaDB,我担心有什么问题。

NB 尝试下一个命令似乎表明这已经失败:

mike@M17A ~ $  sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.2).
0 to upgrade, 0 to newly install, 0 to remove and 600 not to upgrade.

... 即系统仍然认为 4.2.6 是最新版本。

更一般地说,在 Linux 中安装新软件的协议究竟是什么:上面的编号列表(从 1 到 5)是正确的方法吗?专家安装新软件的方法的优先顺序是什么?

然后我尝试了什么

似乎失败sudo apt-get update是问题的根源。

受其他问题的启发,我尝试了这个:

sudo rm /var/lib/apt/lists/* -vf

其次是:

sudo apt-get update

更多对我来说意义不大的错误和警告列表:

...
Err:40 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main amd64 Packages
  404  Not Found
Ign:41 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main i386 Packages
Ign:42 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main all Packages
Ign:43 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en_GB
Ign:44 https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena/main Translation-en
Fetched 329 kB in 28s (11.6 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch http://repository.spotify.com/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
W: Some index files failed to download. They have been ignored, or old ones used instead.

后来我在github页面尝试了“手动安装”...... 以同样的方式失败:

mike@M17A ~ $  VERSION=node_10.16.3
mike@M17A ~ $  DISTRO="$(lsb_release -s -c)"
mike@M17A ~ $  echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
deb https://deb.nodesource.com/node_10.16.3 sylvia main
mike@M17A ~ $  echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
deb-src https://deb.nodesource.com/node_10.16.3 sylvia main
mike@M17A ~ $  sudo apt-get update
Hit:1 http://ppa.launchpad.net/adabbas/1stppa/ubuntu xenial InRelease
...

Ign:57 https://deb.opera.com/opera-stable stable/non-free Translation-en
Err:58 https://deb.opera.com/opera-stable stable/non-free amd64 Packages
  503  Backend unavailable, connection timeout
Ign:59 https://deb.opera.com/opera-stable stable/non-free i386 Packages
Fetched 3,316 B in 34s (95 B/s)
Reading package lists... Done
W: The repository 'https://deb.nodesource.com/node_10.x sylvia Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
W: The repository 'http://repository.spotify.com stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu serena Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'https://deb.opera.com/opera-stable stable Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://deb.nodesource.com/node_10.x/dists/sylvia/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu/dists/serena/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://deb.opera.com/opera-stable/dists/stable/non-free/binary-amd64/Packages  503  Backend unavailable, connection timeout
E: Some index files failed to download. They have been ignored, or old ones used instead.
linux-mint
  • 2 个回答
  • 7935 Views
Martin Hope
mike rodent
Asked: 2018-05-22 23:06:20 +0800 CST

在不使用鼠标的情况下使用终端菜单?

  • 1

我最近安装了 Linux Mint 18.1,并且一直在使用终端。我的终端是 GNOME 版本 3.18.3。

GNOME 终端中有各种菜单。在 Windows 中,您通常通过 Alt-E 访问类似“编辑”的内容。这不适用于终端。有什么方法可以在不强制使用鼠标的情况下访问这些菜单?

linux-mint terminal
  • 1 个回答
  • 276 Views
Martin Hope
mike rodent
Asked: 2018-01-15 07:59:09 +0800 CST

在“滚动”到上一个命令之后使用 BASH ......然后如何移动到这个历史记录中的下一个?

  • 59

抱歉,这个标题不是我设计过的最优雅的。

但我想很多人都会想知道这一点,我的问题可能是一个骗局……我只能说我还没有找到它。

当我说“向上滚动”时,我的意思是使用键盘上的“向上箭头”键,这显然会让您向上滚动浏览历史记录,从最近的命令开始。

所以你发现一个命令可能是 30 个命令......然后你运行它。然后你想运行最初出现在它之后的命令......有没有一种快速的方式来做到这一点?或者那些精通 BASH 的人是如何做到这一点的?

bash command-history
  • 3 个回答
  • 4620 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve