首页 > 系统相关 >记一次Ubuntu系统修改自带Python软连接的错误

记一次Ubuntu系统修改自带Python软连接的错误

时间:2022-12-08 19:33:26浏览次数:53  
标签:... Python error init dpkg Ubuntu 自带 cloud

操作系统;Ubuntu 20.04

刚装上系统,看了一下有Python,由于是Python3.10,所有想将Python3命令修改为Python命令,感觉更顺手,于是就把  /usr/bin/目录下的Python3软连接名称修改成了Python

 

命令:sudo apt-get upgrade 报错信息:Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages have been kept back: python3-distupgrade ubuntu-release-upgrader-core The following packages will be upgraded: cloud-init 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 1 not fully installed or removed. Need to get 0 B/526 kB of archives. After this operation, 121 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Preconfiguring packages ... (Reading database ... 70652 files and directories currently installed.) Preparing to unpack .../cloud-init_22.4.2-0ubuntu0~22.04.1_all.deb ... /var/lib/dpkg/info/cloud-init.prerm: 19: py3clean: not found dpkg: warning: old cloud-init package pre-removal script subprocess returned error exit status 127 dpkg: trying script from the new package instead ... /var/lib/dpkg/tmp.ci/prerm: 19: py3clean: not found dpkg: error processing archive /var/cache/apt/archives/cloud-init_22.4.2-0ubuntu0~22.04.1_all.deb (--unpack): new cloud-init package pre-removal script subprocess returned error exit status 127 /var/lib/dpkg/info/cloud-init.postinst: 414: py3compile: not found dpkg: error while cleaning up: installed cloud-init package post-installation script subprocess returned error exit status 127 Errors were encountered while processing: /var/cache/apt/archives/cloud-init_22.4.2-0ubuntu0~22.04.1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

 修改之后发现apt命令出问题了,网上找半天说和info文件夹有关,照着弄一直没有弄好,由于是新装的系统,只动了系统里面的Python所以我改回来就正常了

总结:Ubuntu中自带的Python没必要不要去动,需要直接用Python再创建一个软连接即可

ln -s 源文件 目标文件

ln -s /usr/bin/Python.3.10  /usr/bin/Python

 

标签:...,Python,error,init,dpkg,Ubuntu,自带,cloud
From: https://www.cnblogs.com/tangyuantest/p/16967078.html

相关文章

  • 6.python-练习定义函数
    defprint_content(content):print(content)defget_sentence_constituent(sentence,constituent):returninput("请输入%s的%s:"%(sentence,constituent))......
  • python5
    一、使用字符串拼接输出一个关于程序员的笑话programmer_1='程序员甲:搞IT太辛苦了,我想换行……怎么办?'programmer_2='程序员乙:敲一下回车键'print(programmer_1+programme......
  • Python判断一个变量值是否为数字数值类型
    fromnumbersimportNumberisinstance(x,Number)下面是源代码中关于Number的描述classNumber(metaclass=ABCMeta):"""Allnumbersinheritfromthisclass.......
  • python基础之条件判断语句(笔记)
    #条件判断语句(if语句)#语法:if条件表达式: #     代码块#执行的流程:if语句在执行时,会先对条件表达式进行求值判断,# 如果为True,则执行if后的语句# ......
  • python123_第七周练习_程序设计题
    羽毛球计分规则:1.21分制,3局2胜为佳2.每球得分制3.每回合中,取胜的一方加1分4.当双方均为20分时,领先对方2分的一方赢得该局比赛5.当双方均为29分时,先取得30......
  • 用python计算圆周率PI
    描述用python计算圆周率PI要求能算到小数点后面越多越好(5分)‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪......
  • Python7段数码管绘制
    #七段数码管绘制importturtleastimporttimeasTdefdrawGap():#绘制数码管的间隔t.penup()t.fd(5)defdrawLine(draw):#绘制单段数码管,draw为True时,则实......
  • Python 7段数码管绘制
    #七段数码管绘制importturtleastimporttimeasTdefdrawGap():#绘制数码管的间隔t.penup()t.fd(5)defdrawLine(draw):#绘制单段数码管,draw为True时,则实......
  • Python全栈工程师之从网页搭建入门到Flask全栈项目实战(5) - Flask中的ORM使用
    1.理解ORMORM是MTV模型里面的Model模型ORM(ObjectRelationalMapping),对象关系映射举例:学生选课学生和课程这两个实体,一个学生可以选择多门课程,一个课程可以被多名......
  • python 中的递归演示
    递归函数递归就是一个函数在它本身内调用它自己。执行递归函数将反复调用自己,每一次调用就会进入新的一层,递归函数必须要有结束条件。当函数一直递推直到遇到墙后但返......