没有输入和输出声音设备。删除后无法安装 Pulseaudio

没有输入和输出声音设备。删除后无法安装 Pulseaudio

我最近通过删除 pulseaudio 修复了损坏的软件包,因为我无法安装研究所需的任何其他软件包(顺便说一下,我使用的是 20.04)。删除 pulseaudio 似乎解决了我的问题。我现在可以安装其他软件包了。结果发现,删除 pulseaudio 后,我的声音设备没有任何输入和输出。

在此处输入图片描述

我甚至下载pulseaudio_13.99.1-1ubuntu3_amd64.deb并安装它,但由于这个重复的错误而失败:

unable to make backup link of './usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common' before installing new version: Operation not permitted

在此处输入图片描述

我尝试了网上很多方法,但都失败了。任何帮助我都会很感激。

编辑[12-29-21]

正如我上面所说。我已经删除了pulseaudio,当尝试再次安装它时,总是会出现以下错误:

这是我尝试时的输出apt-cache policy pulseaudio

在此处输入图片描述

编辑 [12-30-21 | 凌晨 1:12]

snap按照建议运行后@nobody,我发现pulseaudio这里:

Name                    Version                     Rev    Tracking         Publisher               Notes
bare                    1.0                         5      latest/stable    canonical✓              base
canonical-livepatch     10.1.2                      126    latest/stable    canonical✓              -
core                    16-2.52.1                   11993  latest/stable    canonical✓              core
core18                  20211028                    2253   latest/stable    canonical✓              base
core20                  20211129                    1270   latest/stable    canonical✓              base
evince                  41.3                        1008   latest/stable    ken-vandine             -
figma-linux             0.9.3                       149    latest/stable    youdonthavepermissiony  -
gnome-3-28-1804         3.28.0-19-g98f9e67.98f9e67  161    latest/stable    canonical✓              -
gnome-3-34-1804         0+git.3556cb3               77     latest/stable/…  canonical✓              -
gnome-3-38-2004         0+git.cd626d1               87     latest/stable    canonical✓              -
gtk-common-themes       0.1-59-g7bca6ae             1519   latest/stable/…  canonical✓              -
heroku                  v7.59.1                     4078   latest/stable    heroku✓                 classic
jupyter                 1.0.0                       6      latest/stable    projectjupyter✓         -
pdftk                   2.02-4                      9      latest/stable    smoser                  -
postman                 7.36.5                      133    latest/stable    postman-inc✓            -
pulseaudio              8.0-3                       9      latest/stable    canonical✓              -
simplescreenrecorder    0.1                         1      latest/stable    xiaoguo                 -
snap-store              3.38.0-66-gbd5b8f7          558    latest/stable/…  canonical✓              -
snapd                   2.53.4                      14295  latest/stable    canonical✓              snapd
telegram-desktop        3.3.1-beta-4-gffe420859     3492   latest/edge      telegram.desktop        -
utorrent                3.5.5.45828                 97     latest/stable    mmtrt                   -
wine-platform-3-stable  3.0.4                       14     latest/stable    mmtrt                   -
wine-platform-runtime   v1.0                        277    latest/stable    mmtrt                   -
zoom-client             5.9.1.1380                  167    latest/stable    ogra                    -

当我尝试时,sudo apt-get install pulseaudio输出如下所示:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  pavumeter paman paprefs ubuntu-sounds
The following NEW packages will be installed:
  pulseaudio
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/814 kB of archives.
After this operation, 4,645 kB of additional disk space will be used.
Selecting previously unselected package pulseaudio.
(Reading database ... 540571 files and directories currently installed.)
Preparing to unpack .../pulseaudio_1%3a13.99.1-1ubuntu3.13_amd64.deb ...
Unpacking pulseaudio (1:13.99.1-1ubuntu3.13) ...
dpkg: error processing archive /var/cache/apt/archives/pulseaudio_1%3a13.99.1-1ubuntu3.13_amd64.deb (--unpack):
 unable to make backup link of './usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common' before installing new version: Operation not permitted
Errors were encountered while processing:
 /var/cache/apt/archives/pulseaudio_1%3a13.99.1-1ubuntu3.13_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我认为pulseaudio安装的 viasnap没有出现或存在一些问题导致新安装出错。我不确定。

当我尝试按照 的建议进行sed -i s,//ph.archive,//archive,g /etc/apt/sources.list操作时,输出如下所示:sudo apt update@nobody

reymond@RMesuga:~$ sed -i s,//ph.archive,//archive,g  /etc/apt/sources.list
sed: couldn't open temporary file /etc/apt/sedeUQrNF: Permission denied
reymond@RMesuga:~$ sudo sed -i s,//ph.archive,//archive,g  /etc/apt/sources.list
[sudo] password for reymond: 
reymond@RMesuga:~$ sudo apt update
Ign:1 cdrom://Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731) focal InRelease
Err:2 cdrom://Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731) focal Release
  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 http://packages.microsoft.com/repos/edge stable InRelease                
Hit:5 http://packages.microsoft.com/repos/code stable InRelease                
Hit:6 https://packages.microsoft.com/repos/vscode stable InRelease             
Get:7 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]                
Hit:8 https://packages.microsoft.com/repos/ms-teams stable InRelease           
Hit:9 http://security.ubuntu.com/ubuntu focal-security InRelease               
Hit:10 http://ppa.launchpad.net/apandada1/droidcam/ubuntu focal InRelease      
Hit:11 http://archive.canonical.com/ubuntu focal InRelease                     
Hit:12 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease            
Hit:13 https://download.sublimetext.com apt/stable/ InRelease                  
Ign:14 http://ppa.launchpad.net/noobslab/icons2/ubuntu focal InRelease         
Get:15 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] 
Get:16 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]     
Ign:17 http://ppa.launchpad.net/octave/stable/ubuntu focal InRelease
Get:18 http://archive.ubuntu.com/ubuntu focal/main Sources [847 kB]      
Ign:19 http://ppa.launchpad.net/paolorotolo/droidcam/ubuntu focal InRelease   
Get:20 http://archive.ubuntu.com/ubuntu focal/restricted Sources [6,472 B]    
Get:21 http://archive.ubuntu.com/ubuntu focal/universe Sources [9,707 kB]
Hit:22 http://ppa.launchpad.net/scribus/ppa/ubuntu focal InRelease             
Ign:23 http://ppa.launchpad.net/snwh/pulp/ubuntu focal InRelease               
Err:24 http://ppa.launchpad.net/noobslab/icons2/ubuntu focal Release
  404  Not Found [IP: 91.189.95.85 80]
Err:25 http://ppa.launchpad.net/octave/stable/ubuntu focal Release             
  404  Not Found [IP: 91.189.95.85 80]
Get:26 http://archive.ubuntu.com/ubuntu focal/multiverse Sources [174 kB]      
Get:27 http://archive.ubuntu.com/ubuntu focal/main i386 Packages [718 kB]      
Err:28 http://ppa.launchpad.net/paolorotolo/droidcam/ubuntu focal Release      
  404  Not Found [IP: 91.189.95.85 80]
Get:29 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [970 kB]     
Get:30 http://archive.ubuntu.com/ubuntu focal/main Translation-en [506 kB]     
Err:31 http://ppa.launchpad.net/snwh/pulp/ubuntu focal Release                 
  404  Not Found [IP: 91.189.95.85 80]
Get:32 http://archive.ubuntu.com/ubuntu focal/main amd64 DEP-11 Metadata [494 kB]
Get:33 http://archive.ubuntu.com/ubuntu focal/main DEP-11 48x48 Icons [98.4 kB]
Get:34 http://archive.ubuntu.com/ubuntu focal/main DEP-11 64x64 Icons [163 kB] 
Get:35 http://archive.ubuntu.com/ubuntu focal/main DEP-11 64x64@2 Icons [15.8 kB]
Get:36 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata [29.5 kB]
Get:37 http://archive.ubuntu.com/ubuntu focal/restricted i386 Packages [8,112 B]
Get:38 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [22.0 kB]
Get:39 http://archive.ubuntu.com/ubuntu focal/restricted Translation-en [6,212 B]
Get:40 http://archive.ubuntu.com/ubuntu focal/restricted amd64 c-n-f Metadata [392 B]
Get:41 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages [4,642 kB]
Get:42 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8,628 kB]
Get:43 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5,124 kB]
Get:44 http://archive.ubuntu.com/ubuntu focal/universe amd64 DEP-11 Metadata [3,603 kB]
Get:45 http://archive.ubuntu.com/ubuntu focal/universe DEP-11 48x48 Icons [3,016 kB]
Get:47 http://archive.ubuntu.com/ubuntu focal/universe DEP-11 64x64 Icons [7,794 kB]
Get:49 http://archive.ubuntu.com/ubuntu focal/universe DEP-11 64x64@2 Icons [44.3 kB]
Get:50 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:51 http://archive.ubuntu.com/ubuntu focal/multiverse i386 Packages [74.7 kB]
Get:52 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:53 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:54 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 DEP-11 Metadata [48.4 kB]
Get:55 http://archive.ubuntu.com/ubuntu focal/multiverse DEP-11 48x48 Icons [23.1 kB]
Get:56 http://archive.ubuntu.com/ubuntu focal/multiverse DEP-11 64x64 Icons [192 kB]
Get:57 http://archive.ubuntu.com/ubuntu focal/multiverse DEP-11 64x64@2 Icons [214 B]
Get:58 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9,136 B]
Get:59 http://archive.ubuntu.com/ubuntu focal-updates/restricted Sources [29.0 kB]
Get:60 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Sources [19.0 kB]
Get:61 http://archive.ubuntu.com/ubuntu focal-updates/universe Sources [213 kB]
Get:62 http://archive.ubuntu.com/ubuntu focal-updates/main Sources [454 kB]    
Get:63 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [574 kB]
Get:64 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,400 kB]
Hit:46 https://packagecloud.io/github/git-lfs/ubuntu focal InRelease           
Get:65 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [283 kB]
Get:66 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [277 kB]
Get:67 http://archive.ubuntu.com/ubuntu focal-updates/main DEP-11 48x48 Icons [60.8 kB]
Get:68 http://archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64 Icons [98.3 kB]
Get:69 http://archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64@2 Icons [29 B]
Get:70 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [14.7 kB]
Get:71 http://archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages [21.8 kB]
Get:72 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [616 kB]
Get:73 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [88.1 kB]
Get:74 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [528 B]
Get:75 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [884 kB]
Get:76 http://archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [654 kB]
Get:77 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [193 kB]
Get:78 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [363 kB]
Get:79 http://archive.ubuntu.com/ubuntu focal-updates/universe DEP-11 48x48 Icons [219 kB]
Hit:48 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease 
Get:80 http://archive.ubuntu.com/ubuntu focal-updates/universe DEP-11 64x64 Icons [393 kB]
Get:81 http://archive.ubuntu.com/ubuntu focal-updates/universe DEP-11 64x64@2 Icons [29 B]
Get:82 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [19.9 kB]
Get:83 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [24.8 kB]
Get:84 http://archive.ubuntu.com/ubuntu focal-updates/multiverse i386 Packages [8,456 B]
Get:85 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [6,928 B]
Get:86 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:87 http://archive.ubuntu.com/ubuntu focal-updates/multiverse DEP-11 48x48 Icons [1,865 B]
Get:88 http://archive.ubuntu.com/ubuntu focal-updates/multiverse DEP-11 64x64 Icons [2,498 B]
Get:89 http://archive.ubuntu.com/ubuntu focal-updates/multiverse DEP-11 64x64@2 Icons [29 B]
Get:90 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [616 B]
Get:91 http://archive.ubuntu.com/ubuntu focal-backports/main Sources [6,584 B] 
Get:92 http://archive.ubuntu.com/ubuntu focal-backports/universe Sources [4,624 B]
Get:93 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [42.0 kB]
Get:94 http://archive.ubuntu.com/ubuntu focal-backports/main i386 Packages [34.5 kB]
Get:95 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [10.0 kB]
Get:96 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,992 B]
Get:97 http://archive.ubuntu.com/ubuntu focal-backports/main DEP-11 48x48 Icons [6,977 B]
Get:98 http://archive.ubuntu.com/ubuntu focal-backports/main DEP-11 64x64 Icons [10.5 kB]
Get:99 http://archive.ubuntu.com/ubuntu focal-backports/main DEP-11 64x64@2 Icons [29 B]
Get:100 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [864 B]
Get:101 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:102 http://archive.ubuntu.com/ubuntu focal-backports/universe i386 Packages [10.5 kB]
Get:103 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [18.9 kB]
Get:104 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [7,492 B]
Get:105 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [11.3 kB]
Get:106 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 48x48 Icons [4,959 B]
Get:107 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64 Icons [8,416 B]
Get:108 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64@2 Icons [29 B]
Get:109 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [636 B]
Get:110 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Reading package lists... Done                                                  
E: The repository 'cdrom://Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731) focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://packages.microsoft.com/repos/vscode stable InRelease' does not seem to provide it (sources.list entry misspelt?)
W: Skipping acquire of configured file 'Sources' as repository 'https://download.sublimetext.com apt/stable/ InRelease' does not seem to provide it (sources.list entry misspelt?)
E: The repository 'http://ppa.launchpad.net/noobslab/icons2/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/octave/stable/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/paolorotolo/droidcam/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/snwh/pulp/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

<strong>Edit [12-30-21 | 4:10 am]</strong><br>
All problems are SOLVED!!! Thanks to @nobody. To people who might be facing the same issue in the future, please check the accepted answer followed by the comments. The additional comments that she put there is is crucial part of the solution. Thanks again people especially to @nobody !!!

答案1

噢噢噢,

sudo cp /etc/apt/sources.list /etc/apt/sources.list.save

首先我们复制 sources.list。

sudo nano /etc/apt/sources.list

搜索名称中包含 cdrom 的行并删除此行

我的错误我忘记了 sudo

sudo sed -i s,//ph.archive,//archive,g /etc/apt/sources.list

然后将 /etc/apt/sources.list.d/ 下的任何文件 mv 到 $HOME 中的文件夹中

mkdir $HOME/ppa-backup

然后 mv

sudo mv /etc/apt/sources.list.d/* $HOME/ppa-backup/

现在我们摆脱这个 pulseaudio snap

sudo snap remove pulseaudio 
    sudo apt-get clean

这将清除 /var/cache/apt/archives/ 中的缓存,现在我们让 apt 忘记有哪些软件包可用

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

sudo apt update

使用新信息重新创建已删除的文件。

sudo apt full-upgrade

然后最后安装 pulseaudio

sudo apt install pulseaudio

编辑于 12-30-21
除最后安装 pulseaudio 的命令外,上述所有命令均有效。然后我按照以下建议尝试了此命令@nobody

sudo mv /usr/share/pulseaudio /usr/share/pulseaudio.bak

随后

sudo apt install pulseaudio

如果不再有错误,则reboot您的计算机立即恢复。请查看评论部分,因为@nobody 女士找到了问题的解决方案。这一切都要感谢她!

答案2

运行以下命令以获取最新的包信息并安装 pulseaudio:

sudo apt-get update(这将获得更新)

sudo apt-get autoclean && sudo apt-get autoremove(这将删除过时的软件包)

sudo apt-get --fix-broken install(修复损坏的包裹)

sudo apt-get upgrade(这严格升级当前的软件包)

sudo apt-get install pulseaudio

相关内容