sudo apt-get install 报错 software-properties-common : Depends: python3:any (>= 3.3.2-2~)

本文主要是介绍sudo apt-get install 报错 software-properties-common : Depends: python3:any (>= 3.3.2-2~),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

  • 1. 问题描述
  • 2. 解决问题
    • 💢2.1 修改镜像源(对我的问题无效)
    • 2.2 自己摸索
    • 2.3 切换系统shell

1. 问题描述

  • 想使用sudo add-apt-repository ppa:openjdk-r/ppa这个命令,但是提示没有add-apt-repository命令,股进行安装
  • add-apt-repository 命令是software-properties-common包的一部分,因此安装这个包就OK了。
  • 但是一度报错。。。
    > sudo apt-get install software-properties-common 
    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:software-properties-common : Depends: python3:any (>= 3.3.2-2~)Depends: python3 but it is not going to be installedDepends: python3-gi but it is not going to be installedDepends: python3-dbus but it is not going to be installedDepends: python3-software-properties (= 0.92.37.8) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    

2. 解决问题

💢2.1 修改镜像源(对我的问题无效)

如果要使用清华的源,需要先查看自己系统版本,再去选择合适的镜像源

cat /proc/version
> Linux version 4.4.0-186-generic (buildd@lcy01-amd64-002) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ) #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020vim /etc/apt/sources.list   
# 在其中加入清华的源 不要删除之前的内容,都保留加上去就可以
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse# 编辑完成,回到shell中
sudo apt-get update 
# 更新一下源 (会去检索刚刚新加的apt-get源)

或者可以使用阿里源,操作都一样,复制上去就行,记得sudo apt-get update一下源。


  • https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
    在这里插入图片描述
  • ✅Ubuntu 16.04配置国内高速apt-get更新源
  • apt-get 详解&&配置阿里源
  • Ubuntu报错software-properties-common : Depends: python3-software-properties

2.2 自己摸索

参考:

  • 无法安装python3的连续报错-mysql include软链接问题
  • Depends:xxx but it is not going to be installed

给了我一些启发,既然有报错信息,缺什么依赖,那就一路安到底,看到底哪里出了问题。

sudo apt-get install software-properties-common
>  software-properties-common : Depends: python3:any (>= 3.3.2-2~)
# 缺这个依赖,那就安装这个依赖sudo apt-get install python3
>  python3 : Depends: python3.4 (>= 3.4.0-0~) but it is not going to be installed# 继续看下一个依赖sudo apt-get install python3.4
> python3.4-minimal : Depends: libpython3.4-minimal (= 3.4.3-1ubuntu1~14.04.7) but it is not going to be installed# 继续看下一个依赖
sudo apt-get install libpython3.4-minimal
> To continue type in the phrase 'Yes, do as I say!'?] `Yes, do as I say! `# 这个字符串需要自己手动敲进去,要长得一模一样
# 不过这个执行的时候报错了
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

另外,参考:ubuntu apt-get安装或卸载软件时出现了python-minimal等错误问题的解决方法

sudo apt-get update --fix-missing
# 修复缺失的包
sudo apt-get autoremove && sudo apt-get clean && sudo apt-get install -f
# 自动清理 修复

执行完上述两条命令之后,再去进行安装,这次出现了和之前不同的信息,

sudo apt-get install software-properties-common

在这里插入图片描述
这种方式是ok的,但是,在检索到所有需要的22个包的信息之后,报了和上面一样的错误。
在这里插入图片描述
解决错误

dpkg: warning: 'find' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

参考:linux误删libc-bin出现dpkg: warning: ‘ldconfig’ not found in PATH or not executable和ubuntu安装octave的小坑
简单来说,就是缺东西了,找不到/sbin目录下的ldconfig了,查看自己文件夹:
在这里插入图片描述

  • 这个文件夹竟然是空的。。。分别查看/usr/local/sbin, /usr/sbin and /sbin这三个文件夹下有没有/sbin/ldconfig/sbin/ldconfig.real文件。
  • 最后在/sbin这个文件夹中看到了/sbin/ldconfig/sbin/ldconfig.real这两个文件。
    在这里插入图片描述
    另外,博客中好像要复原这个配置文件,需要重新安装libc-bin,但是这个包其实是包含在sudo apt-get install build-essential这个里的
sudo apt-get install build-essential
[sudo] password for enadmin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
binutils cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6
libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
`libc-bin` libc-dev-bin libc6 libc6-dev libdpkg-perl libgomp1 libmpc2 libmpfr4
libquadmath0 libstdc++6-4.6-dev linux-libc-dev manpages-dev

所以应该不是这个问题。

另外,

  • 参考:https://askubuntu.com/questions/399438/how-to-solve-dpkg-error-1-expected-program-not-found-in-path-or-not-executabl
    可能是因为系统路径的问题
    echo $PATH
    > /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
    
  • 参考:‘dpkg-deb’ not found in PATH or not executable
    除了普通用户的PATH,其实还有root用户的PATH呢
    sudo grep -i path /etc/sudoers
    > Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
    
    另外,也可以看看当前这个报错找不到的程序的情况:
    sudo find / -mount -name find -exec ls -ld {} +
    

但是可以看到,其中是包含/sbin这个目录的,那把这个复制过去,复制到/usr/local/sbin这个目录中,也许是真的找不到???

  • 启发之下,可以看到,这个zsh的shell里就没有find这个程序。。。尴尬。
    在这里插入图片描述
  • 其实常规情况下,问题到这里就可以解决了。 我的特殊在于,服务器是公用的,有人把默认的find命令屏蔽了,所以一直找不到。同时zsh这个shell也是被人配置过了,所以一直有问题。
  • 而且这个zsh的shell和bash的shell的切换问题是。可以切换到root用户,root用户默认的shell是bash的shell,使用以下命令
sudo su
# 输入密码之后就进入了root用户权限

参考:

  • 使用sudo命令完成root权限操作

2.3 切换系统shell

参考:

  • linux查看用户默认shell、当前用户shell类型、系统支持shell类型
  • linux、mac的bash和zsh如何切换

查询用户默认shell

cat /etc/passwd

在这里插入图片描述
查看当前用户shell

(base) /sbin > echo $SHELL
/bin/bash

查看当前系统支持的shell的类型

(base) /sbin > cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/tmux
/usr/bin/screen
/bin/zsh
/usr/bin/zsh

所以这里我用的应该就是bash???

(base) /sbin > echo $SHELL    
/bin/bash
(base) /sbin > find       
zsh: command not found: find

但是就很矛盾??明明显示是bash的shell,但是报错却是zsh??

切换zsh为bash试试

chsh -s /bin/bash #切换成bash
chsh -s /bin/zsh # 切换成zsh

这篇关于sudo apt-get install 报错 software-properties-common : Depends: python3:any (>= 3.3.2-2~)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/189084

相关文章

Python3 BeautifulSoup爬虫 POJ自动提交

POJ 提交代码采用Base64加密方式 import http.cookiejarimport loggingimport urllib.parseimport urllib.requestimport base64from bs4 import BeautifulSoupfrom submitcode import SubmitCodeclass SubmitPoj():de

Jenkins 插件 地址证书报错问题解决思路

问题提示摘要: SunCertPathBuilderException: unable to find valid certification path to requested target...... 网上很多的解决方式是更新站点的地址,我这里修改了一个日本的地址(清华镜像也好),其实发现是解决不了上述的报错问题的,其实,最终拉去插件的时候,会提示证书的问题,几经周折找到了其中一遍博文

【Python报错已解决】AttributeError: ‘list‘ object has no attribute ‘text‘

🎬 鸽芷咕:个人主页  🔥 个人专栏: 《C++干货基地》《粉丝福利》 ⛺️生活的理想,就是为了理想的生活! 文章目录 前言一、问题描述1.1 报错示例1.2 报错分析1.3 解决思路 二、解决方法2.1 方法一:检查属性名2.2 步骤二:访问列表元素的属性 三、其他解决方法四、总结 前言 在Python编程中,属性错误(At

DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed

DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed 文章目录 DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed问题解决办法 问题 使用 DBeaver 连接 MySQL 数据库的时候, 一直报错下面的错误 Public Key Retrieval is

vue 父组件调用子组件的方法报错,“TypeError: Cannot read property ‘subDialogRef‘ of undefined“

vue 父组件调用子组件的方法报错,“TypeError: Cannot read property ‘subDialogRef’ of undefined” 最近用vue做的一个界面,引入了一个子组件,在父组件中调用子组件的方法时,报错提示: [Vue warn]: Error in v-on handler: “TypeError: Cannot read property ‘methods

10 Source-Get-Post-JsonP 网络请求

划重点 使用vue-resource.js库 进行网络请求操作POST : this.$http.post ( … )GET : this.$http.get ( … ) 小鸡炖蘑菇 <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-w

Vue3上传图片报错:Current request is not a multipart request

当你看到错误 "Current request is not a multipart request" 时,这通常意味着你的服务器或后端代码期望接收一个 multipart/form-data 类型的请求,但实际上并没有收到这样的请求。在使用 <el-upload> 组件时,如果你已经设置了 http-request 属性来自定义上传行为,并且遇到了这个错误,可能是因为你在发送请求时没有正确地设置

API28_OKgo_get注意事项

1: implementation 'com.lzy.net:okgo:2.1.4' 2:在BaseApplication中onCreate()中初始化initOKgo() private void initOKgo() {//---------这里给出的是示例代码,告诉你可以这么传,实际使用的时候,根据需要传,不需要就不传-------------//HttpHeaders headers

QT 编译报错:C3861: ‘tr‘ identifier not found

问题: QT 编译报错:C3861: ‘tr’ identifier not found 原因 使用tr的地方所在的类没有继承自 QObject 类 或者在不在某一类中, 解决方案 就直接用类名引用 :QObject::tr( )

笔记本电脑开机报错故障的原因及解决办法

笔记本电脑开机报错故障是指笔记本电脑开机自检时或启动操作系统前停止启动,在显示屏 出现一些错误提示的故障。   笔记本电脑开机报错故障的原因及解决办法   造成此类故障的原因一般是笔记本电脑在启动自检时,检测到硬件设备不能正常工作或在自 检通过后从硬盘启动时,出现硬盘的分区表损坏、硬盘主引导记录损坏、硬盘分区结束标志丢失 等故障,笔记本电脑出现相应的故障提示。   维修此类故障时