我需要在 apt 更新期间跳过损坏的 url,出现错误 403。
我知道 url 可能会在下周修复,但我现在需要升级我的其他软件包。
如何在 apt update 期间跳过一个 url,以便我可以成功更新我的软件包列表以运行 apt upgrade?
我需要在 apt 更新期间跳过损坏的 url,出现错误 403。
我知道 url 可能会在下周修复,但我现在需要升级我的其他软件包。
如何在 apt update 期间跳过一个 url,以便我可以成功更新我的软件包列表以运行 apt upgrade?
我通过直接从他们的网站下载安装包安装了一堆NVIDIA工具(例如nvidia nsight compute;nvidia visual profiler)。现在我想使用 apt sudo apt purge nvidia删除所有这些 NVIDIA 软件,但 apt 报告说它们都没有安装。我也试过 dpkg --list nvidia,但也没有列出任何内容。但这些软件都列在“显示应用程序”中。
我也试过快照。它也无法检测到这些包。
ImportError
安装后尝试使用 Nala 时出现以下问题:
$ sudo nala update
Traceback (most recent call last):
File "/usr/bin/nala", line 5, in <module>
from nala.__main__ import main
File "/usr/lib/python3/dist-packages/nala/__main__.py", line 30, in <module>
import nala.fetch as _fetch # pylint: disable=unused-import
File "/usr/lib/python3/dist-packages/nala/fetch.py", line 37, in <module>
import typer
File "/usr/lib/python3/dist-packages/typer/__init__.py", line 12, in <module>
from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/usr/lib/python3/dist-packages/click/termui.py)
这是在已升级到 22.04 的服务器安装上,而不是从 22.04 的全新安装。从历史上看,这台服务器最初是用12.04搭建的,后来升级了几次到22.04。
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
Nala 的安装如下:
sudo apt install nala
作为测试,我在 Virtual Box 机器上全新安装的 Ubuntu 22.04 上安装了 Nala,它运行良好。所以看起来问题与该系统升级到 22.04 有关。
我还做了以下事情:
wget https://gitlab.com/volian/volian-archive/uploads/b20bd8237a9b20f5a82f461ed0704ad4/volian-archive-keyring_0.1.0_all.deb\
wget https://gitlab.com/volian/volian-archive/uploads/d6b3a118de5384a0be2462905f7e4301/volian-archive-nala_0.1.0_all.deb
sudo apt install ./volian-archive*.deb
sudo apt --purge autoremove nala
sudo apt install nala
附加信息:
那拉版本:
$ apt policy nala
nala:
Installed: 0.12.3
Candidate: 0.12.3
Version table:
*** 0.12.3 100
100 https://deb.volian.org/volian scar/main amd64 Packages
100 https://deb.volian.org/volian scar/main i386 Packages
100 /var/lib/dpkg/status
0.12.2 100
100 https://deb.volian.org/volian scar/main amd64 Packages
100 https://deb.volian.org/volian scar/main i386 Packages
0.11.1~bpo22.04.1 100
100 http://us.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages
100 http://us.archive.ubuntu.com/ubuntu jammy-backports/universe i386 Packages
python3-pip
版本:
$ apt policy python3-pip
python3-pip:
Installed: 22.0.2+dfsg-1ubuntu0.2
Candidate: 22.0.2+dfsg-1ubuntu0.2
Version table:
*** 22.0.2+dfsg-1ubuntu0.2 500
500 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages
500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu jammy-security/universe i386 Packages
100 /var/lib/dpkg/status
22.0.2+dfsg-1 500
500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu jammy/universe i386 Packages
python3-typer
版本:
$ apt policy python3-typer
python3-typer:
Installed: 0.4.0-1
Candidate: 0.4.0-1
Version table:
0.7.0-1 100
100 https://deb.volian.org/volian scar/main amd64 Packages
100 https://deb.volian.org/volian scar/main i386 Packages
*** 0.4.0-1 500
500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu jammy/universe i386 Packages
100 /var/lib/dpkg/status
python3-click
版本:
$ apt policy python3-click
python3-click:
Installed: 8.1.3-2
Candidate: 8.1.3-2
Version table:
*** 8.1.3-2 100
100 https://deb.volian.org/volian scar/main amd64 Packages
100 https://deb.volian.org/volian scar/main i386 Packages
100 /var/lib/dpkg/status
8.0.3-1 500
500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu jammy/main i386 Packages
以下导致没有输出:
$ sudo apt-mark showhold
我不知道如何解决这个问题。有没有人有什么建议?
在 Ubuntu Studio 22.10 和 22.04.1 LTS 中,每次我运行 apt,尤其是 apt update 时,我发现它一直在寻找一个在 /etc/apt/ 目录或其中的文件中不存在的源。起初这只是一个令人费解的刺激,但现在 Ubuntu Studio Discovery 被延迟了多达 3 分钟,显然是在寻找相同的来源。
$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu kinetic InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu kinetic-updates InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu kinetic-backports InRelease [99.9 kB]
Hit:4 http://security.ubuntu.com/ubuntu kinetic-security InRelease
Ign:5 http://archive.canonical.com/ubuntu kinetic InRelease
Err:6 http://archive.canonical.com/ubuntu kinetic Release <<---!!
404 Not Found [IP: 2620:2d:4000:1003::111 80]
Hit:7 https://ppa.launchpadcontent.net/tatokis/alarm-clock-applet/ubuntu kinetic InRelease
Reading package lists... Done
E: The repository 'http://archive.canonical.com/ubuntu kinetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
我尝试了 sudo ppa-purge 和 sudo apt-get install ppa-purge 的各种建议,收到的结果表明它们失败了,因为它们找不到要清除的包。
检查“软件源”我发现这个源没有在任何选项卡下列出。然后我查看了 /etc/apt/ 中的每个目录和文件,再次没有发现这个“http://archive.canonical.com/ubuntu kinetic Release”的迹象
所以问题是“在哪里容易找到寻找这个的指令?” 和“我如何删除它,这样 apt 就不会继续寻找它了?”
以下是我搜索的目录和文件的日志,以确认“http://archive.canonical.com/ubuntu kinetic Release”未在 Ubuntu 源代码或 /etc/apt/ 中列出。
apt sources.list 的内容
$ inxi -r
Repos:
Active apt repos in: /etc/apt/sources.list
1: deb http://us.archive.ubuntu.com/ubuntu/ kinetic main restricted
2: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-updates main restricted
3: deb http://us.archive.ubuntu.com/ubuntu/ kinetic universe
4: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-updates universe
5: deb http://us.archive.ubuntu.com/ubuntu/ kinetic multiverse
6: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-updates multiverse
7: deb http://security.ubuntu.com/ubuntu/ kinetic-security main restricted
8: deb http://security.ubuntu.com/ubuntu/ kinetic-security universe
9: deb http://security.ubuntu.com/ubuntu/ kinetic-security multiverse
10: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-backports main restricted universe multiverse
11: deb http://archive.canonical.com/ubuntu/ kinetic partner
Active apt repos in: /etc/apt/sources.list.d/tatokis-ubuntu-alarm-clock-applet-kinetic.list
1: deb https://ppa.launchpadcontent.net/tatokis/alarm-clock-applet/ubuntu/ kinetic main
我在 /etc/apt/ 和子目录中搜索http://archive.canonical.com/ubuntu kinetic Release
g905:/etc/apt$ ls
apt.conf.d keyrings sources.list sources.list.d trusted.gpg.d
auth.conf.d preferences.d sources.list~ trusted.gpg
g905:/etc/apt$ cd trusted.gpg.d
g905:/etc/apt/trusted.gpg.d$ ls
tatokis-ubuntu-alarm-clock-applet.gpg ubuntu-keyring-2012-cdimage.gpg
tatokis-ubuntu-alarm-clock-applet.gpg~ ubuntu-keyring-2018-archive.gpg
g905:/etc/apt/trusted.gpg.d$ cd ..
g905:/etc/apt$ ls
apt.conf.d keyrings sources.list sources.list.d trusted.gpg.d
auth.conf.d preferences.d sources.list~ trusted.gpg
g905:/etc/apt$ cd sources.list.d
g905:/etc/apt/sources.list.d$ ls
tatokis-ubuntu-alarm-clock-applet-kinetic.list
g905:/etc/apt/sources.list.d$ cd ..
g905:/etc/apt$ cd apt.conf.d
g905:/etc/apt/apt.conf.d$ ls
01autoremove 20archive 50appstream 60icons-large 99update-notifier
01-vendor-ubuntu 20auto-upgrades 50command-not-found 60icons-large-hidpi
10periodic 20dbus 50unattended-upgrades 70debconf
15update-stamp 20packagekit 60icons 88libdvdcss-pkg
20apt-esm-hook.conf 20snapd.conf 60icons-hidpi 99synaptic
g905:/etc/apt/apt.conf.d$ cd ..
g905:/etc/apt$ cd auth.conf.d
g905:/etc/apt/auth.conf.d$ ls [Empty]
g905:/etc/apt/auth.conf.d$ cd ..
g905:/etc/apt$ cd preferences.d
g905:/etc/apt/preferences.d$ ls [Empty]
g905:/etc/apt/preferences.d$ cd ..
再次明确;它还能在哪里?如果不仅仅是删除文件夹或文件,我该如何删除它。
Platform details
Operating System: Ubuntu Studio 22.10
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0 Qt Version: 5.15.6
Kernel Version: 5.19.0-1018-lowlatency (64-bit)
Graphics Platform: X11
Processors: 24 × AMD Ryzen 9 7900X 12-Core Processor
Memory: 31.1 GiB of RAM
Graphics Processor: llvmpipe
Manufacturer: MicroElectronics Product Name: G905 System Version: 1.0
在我布置问题之前,这是我当前的系统信息。
➜ ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
➜ ~ uname -r
5.15.0-67-generic
当我尝试通过运行来升级发行版时
sudo do-release-upgrade -d
我收到消息
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.
我做了sudo apt update && sudo apt upgrade -y
,发现有一个包被升级但没有升级。
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
接下来,我做了sudo apt list --upgradable -a
并得到了
Listing... Done
libcurl3-gnutls/focal 7.87.0-1~20.04.sav0 amd64 [upgradable from: 7.68.0-1ubuntu2.16]
libcurl3-gnutls/focal-updates,focal-security,now 7.68.0-1ubuntu2.16 amd64 [installed,upgradable to: 7.87.0-1~20.04.sav0]
libcurl3-gnutls/focal 7.68.0-1ubuntu2 amd64
当我尝试通过执行安装时sudo apt-get install libcurl3-gnutls
,出现以下错误
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:
libcurl3-gnutls : Depends: libgnutls30 (>= 3.7.2) but 3.6.13-2ubuntu1.8 is to be installed
E: Unable to correct problems, you have held broken packages.
我在这里找到了类似的问题和答案,并尝试了所有答案,但仍未解决。这是我试过的几个命令。
➜ ~ sudo apt-get install -f libcurl3-gnutls
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:
libcurl3-gnutls : Depends: libgnutls30 (>= 3.7.2) but 3.6.13-2ubuntu1.8 is to be installed
E: Unable to correct problems, you have held broken packages.
➜ ~ sudo apt-get install -f libgnutls30
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgnutls30 is already the newest version (3.6.13-2ubuntu1.8).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
最后一件事,当我尝试使用aptitude
tho 时,有更多信息但似乎有风险所以我没有继续(检查第二步)。
sudo aptitude install libcurl3-gnutls
The following packages will be upgraded:
libcurl3-gnutls{b}
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 382 kB of archives. After unpacking 123 kB will be used.
The following packages have unmet dependencies:
libcurl3-gnutls : Depends: libgnutls30 (>= 3.7.2) but 3.6.13-2ubuntu1.8 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libcurl3-gnutls [7.68.0-1ubuntu2.16 (focal-security, focal-updates, now)]
Accept this solution? [Y/n/q/?]
The following actions will resolve these dependencies:
Remove the following packages:
1) colord [1.4.4-2 (focal, now)]
2) fwupd [1.7.9-1~20.04.2 (focal-proposed, now)]
3) gir1.2-vips-8.0 [8.10.5-2ubuntu1tonimelisma2 (focal, now)]
4) git [1:2.25.1-1ubuntu3.10 (focal-security, focal-updates, now)]
5) gnome-control-center [1:3.36.5-0ubuntu4 (focal-updates, now)]
6) hplip [3.20.3+dfsg0-2 (focal, now)]
7) kerneloops [0.12+git20140509-6ubuntu2 (focal, now)]
8) libcfitsio-dev [3.470-3 (focal, now)]
9) libcfitsio8 [3.470-3 (focal, now)]
10) libcurl3-gnutls [7.68.0-1ubuntu2.16 (focal-security, focal-updates, now)]
11) libfwupd2 [1.7.9-1~20.04.2 (focal-proposed, now)]
12) libfwupdplugin5 [1.7.9-1~20.04.2 (focal-proposed, now)]
13) libsane [1.0.29-0ubuntu5.2 (focal-updates, now)]
14) libvips-dev [8.10.5-2ubuntu1tonimelisma2 (focal, now)]
15) libvips-tools [8.10.5-2ubuntu1tonimelisma2 (focal, now)]
16) libvips42 [8.10.5-2ubuntu1tonimelisma2 (focal, now)]
17) network-manager [1.22.10-1ubuntu2.3 (focal-updates, now)]
18) network-manager-config-connectivity-ubuntu [1.22.10-1ubuntu2.3 (focal-updates, now)]
19) network-manager-gnome [1.8.24-1ubuntu3 (focal-updates, now)]
20) network-manager-openvpn [1.8.12-1 (focal, now)]
21) network-manager-openvpn-gnome [1.8.12-1 (focal, now)]
22) network-manager-pptp [1.2.8-2 (focal, now)]
23) network-manager-pptp-gnome [1.2.8-2 (focal, now)]
24) network-manager-strongswan [1.4.5-2.1 (focal, now)]
25) nip2 [8.7.0-1 (focal, now)]
26) sane-utils [1.0.29-0ubuntu5.2 (focal-updates, now)]
27) spotify-client [1:1.1.84.716.gc5f8b819-2 (now, stable)]
28) tig [2.4.1-1ubuntu1 (focal, now)]
29) ubuntu-desktop [1.450.2 (focal-updates, now)]
30) ubuntu-desktop-minimal [1.450.2 (focal-updates, now)]
31) whoopsie [0.2.69ubuntu0.3 (focal-security, focal-updates, now)]
Leave the following dependencies unresolved:
32) cups-filters recommends colord
33) libcolord-gtk1 recommends colord
34) libsane-hpaio recommends hplip (= 3.20.3+dfsg0-2)
35) libsane-hpaio recommends sane-utils
36) cups recommends colord
37) cups-daemon recommends colord
38) fwupd-signed recommends fwupd
...
现在我被困住了,不知道如何解决整个混乱。
的输出apt-cache
➜ ~ sudo apt-cache policy libcurl3-gnutls libgnutls30
libcurl3-gnutls:
Installed: (none)
Candidate: 7.87.0-1~20.04.sav0
Version table:
7.87.0-1~20.04.sav0 500
500 http://ppa.launchpad.net/savoury1/curl34/ubuntu focal/main amd64 Packages
7.68.0-1ubuntu2.16 500
500 http://sg.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://sg.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
7.68.0-1ubuntu2 500
500 http://sg.archive.ubuntu.com/ubuntu focal/main amd64 Packages
libgnutls30:
Installed: 3.6.13-2ubuntu1.7
Candidate: 3.6.13-2ubuntu1.8
Version table:
3.6.13-2ubuntu1.8 500
500 http://sg.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://sg.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
*** 3.6.13-2ubuntu1.7 100
100 /var/lib/dpkg/status
3.6.13-2ubuntu1 500
500 http://sg.archive.ubuntu.com/ubuntu focal/main amd64 Packages
和合适的来源列表
➜ ~ lsa /etc/apt/sources.list.d/*list
Permissions Size User Date Modified Name
.rw-r--r-- 164 root 6 Mar 11:54 /etc/apt/sources.list.d/apandada1-ubuntu-brightness-controller-focal.list
.rw-r--r-- 132 root 6 Mar 11:54 /etc/apt/sources.list.d/apt-fast-ubuntu-stable-focal.list
.rw-r--r-- 109 root 6 Mar 11:54 /etc/apt/sources.list.d/azlux.list
.rw-r--r-- 141 root 6 Mar 11:54 /etc/apt/sources.list.d/brave-browser-release.list
.rw-r--r-- 130 root 6 Mar 11:54 /etc/apt/sources.list.d/docker.list
.rw-r--r-- 130 root 6 Mar 11:54 /etc/apt/sources.list.d/gezakovacs-ubuntu-ppa-focal.list
.rw-r--r-- 189 root 6 Mar 11:54 /etc/apt/sources.list.d/google-chrome.list
.rw-r--r-- 106 root 6 Mar 11:54 /etc/apt/sources.list.d/google-cloud-sdk.list
.rw-r--r-- 140 root 6 Mar 11:54 /etc/apt/sources.list.d/kgilmer-ubuntu-speed-ricer-focal.list
.rw-r--r-- 54 root 6 Mar 11:54 /etc/apt/sources.list.d/kubernetes.list
.rw-r--r-- 92 root 6 Mar 11:54 /etc/apt/sources.list.d/mongodb-org-5.0.list
.rw-r--r-- 140 root 6 Mar 11:54 /etc/apt/sources.list.d/neovim-ppa-ubuntu-unstable-focal.list
.rw-r--r-- 88 root 6 Mar 11:54 /etc/apt/sources.list.d/nextdns.list
.rw-r--r-- 76 root 6 Mar 11:54 /etc/apt/sources.list.d/pgadmin4.list
.rw-r--r-- 132 root 6 Mar 11:54 /etc/apt/sources.list.d/savoury1-ubuntu-curl34-focal.list
.rw-r--r-- 146 root 6 Mar 11:54 /etc/apt/sources.list.d/serge-rider-ubuntu-dbeaver-ce-focal.list
.rw-r--r-- 125 root 6 Mar 11:54 /etc/apt/sources.list.d/signal-xenial.list
.rw-r--r-- 193 root 6 Mar 11:54 /etc/apt/sources.list.d/slack.list
.rw-r--r-- 50 root 6 Mar 11:54 /etc/apt/sources.list.d/spotify.list
.rw-r--r-- 140 root 6 Mar 11:54 /etc/apt/sources.list.d/strukturag-ubuntu-libde265-focal.list
.rw-r--r-- 138 root 6 Mar 11:54 /etc/apt/sources.list.d/strukturag-ubuntu-libheif-focal.list
.rw-r--r-- 50 root 6 Mar 11:54 /etc/apt/sources.list.d/sublime-text.list
.rw-r--r-- 94 root 6 Mar 11:54 /etc/apt/sources.list.d/tailscale.list
.rw-r--r-- 130 root 6 Mar 11:54 /etc/apt/sources.list.d/tonimelisma-ubuntu-ppa-focal.list
.rw-r--r-- 266 root 6 Mar 11:54 /etc/apt/sources.list.d/ubuntu-esm-apps.list
.rw-r--r-- 274 root 6 Mar 11:54 /etc/apt/sources.list.d/ubuntu-esm-infra.list
.rw-r--r-- 203 root 6 Mar 11:54 /etc/apt/sources.list.d/vscode.list
.rw-r--r-- 142 root 6 Mar 11:54 /etc/apt/sources.list.d/wireshark-dev-ubuntu-stable-focal.list
➜ ~
DPDK 通过管理器安装pkg-config
。我使用这些命令从源代码构建:
git clone https://github.com/DPDK/dpdk.git
cd dpdk
meson setup build
cd build
ninja
ninja install
ldconfig
https://doc.dpdk.org/guides/linux_gsg/build_dpdk.html
但是,它安装到/usr/local/lib/x86_64-linux-gnu/pkgconfig
. 相比之下,我所有的其他包都位于/usr/lib/x86_64-linux-gnu/pkgconfig
.
因此pkg-config --list-all
找不到我的 DPDK 包。
我什至设置PKG_CONFIG_PATH
并重/usr/lib/x86_64-linux-gnu/pkgconfig
试,但它仍然安装到相同的路径。
有人可以确认这是否是 Ubuntu 问题以及如何将它与其他软件包一起正确安装?
有没有更简单的方法通过 Ubuntu 包管理器安装 DPDK?我找不到一个。
我正在尝试使用终端应用程序安装 CrossOver。我输入了以下命令行“sudo apt install //crossover_22.1.0-1.deb”。我收到两 (2) 条错误消息。第一个是“命令行上给出的不受支持的文件”。第二个是 dpkg 被中断,你必须手动运行 'sudo dpkg --configure -a' 来纠正这个问题。
我曾经将contrib
&添加non-free
到我的 apt 资源中,但发现它们已经从 jammy 中消失了:
$ sudo apt update
W: Skipping acquire of configured file 'contrib/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't have the component 'contrib' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't have the component 'non-free' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'contrib/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't have the component 'contrib' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't have the component 'non-free' (component misspelt in sources.list?)
然后,如何解决常见问题,例如:
E: Package 'rar' has no installation candidate
E: Package 'unrar' has no installation candidate
$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ jammy main contrib non-free restricted universe
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main contrib non-free restricted universe
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
我正在尝试修复 Ubuntu 20.04 安装,其中有许多需要重新安装的软件包。dpkg --audit
我通过执行(或) 发现了这一点(正如人们所做的那样dpkg -C
),它返回了一个必须重新安装的软件包列表。
由于某种原因,这返回了一个很长的包列表。我可以采取的行动之一是做apt install --reinstall [package-name]
,但至少有几百个包裹,所以那会很烦人和无聊。
有没有办法使这个过程自动化?理想情况下,我正在考虑一种方法来dpkg -C
生成可以提供给 apt 的包名称数组,但我不知道这是否可行。
有什么办法可以利用审计结果,还是必须自己想出一个机制?