我想构建一些源,但它们有一长串的依赖项,是的,我可以手动执行操作 - 构建后然后删除已安装的每个 pkg - 但我认为这个问题一定有更好的解决方案。
- 另外还有一个问题,apt 会将已安装软件包的标记从自动更改为手动,这让我犹豫是否一次性删除所有软件包
抱歉,我提出了多个问题,但我认为它们是相关的。
我想构建一些源,但它们有一长串的依赖项,是的,我可以手动执行操作 - 构建后然后删除已安装的每个 pkg - 但我认为这个问题一定有更好的解决方案。
抱歉,我提出了多个问题,但我认为它们是相关的。
我在 Ubuntu 上尝试删除 linux-image-6.11.0-21-generic 软件包时遇到错误。进程启动后失败,并出现子进程错误(返回代码 1),并提示 update-grub 和文件丢失的问题。终端输出如下:[插入图片或粘贴文本]。我尝试运行sudo apt autoremove
和sudo apt purge
,但问题仍然存在。请问有什么解决方法吗?谢谢!
为了清除 WSL2 上的文件系统,我通过以下方式卸载了 python3
sudo rm -rf /usr/bin/python3
sudo rm -rf /usr/lib/python3
sudo rm -rf /usr/local/lib/python3
反过来,我很难通过 WSL 重新安装和使用 python3.*。当尝试通过 重新安装 python3 时sudo apt-get install --reinstall python3
,出现了类似以下错误。
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
htop libnl-3-200 libnl-genl-3-200 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python-pkg-resources python-setuptools python2 python2-minimal python2.7 python2.7-minimal
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 22 not upgraded.
40 not fully installed or removed.
Need to get 0 B/22.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 99157 files and directories currently installed.)
Preparing to unpack .../python3_3.10.6-1~22.04.1_amd64.deb ...
/var/lib/dpkg/info/python3.prerm: 5: py3clean: not found
dpkg: warning: old python3 package pre-removal script subprocess returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 5: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/python3_3.10.6-1~22.04.1_amd64.deb (--unpack):
new python3 package pre-removal script subprocess returned error exit status 127
/var/lib/dpkg/info/python3.postinst: 47: py3compile: not found
dpkg: error while cleaning up:
installed python3 package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
/var/cache/apt/archives/python3_3.10.6-1~22.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
这让我陷入了几个我完全无法理解的困境。我按照类似的顺序执行了以下命令,然后才意识到我可能造成了更大的问题……
sudo apt purge python3
------
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
apport-symptoms bc blt debhelper debugedit devhelp-common dh-autoreconf dh-strip-nondeterminism distro-info distro-info-data dwz eatmydata fdisk fonts-lyx gdisk gir1.2-atk-1.0 gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gdkpixbuf-2.0
gir1.2-glib-2.0 gir1.2-gtk-2.0 gir1.2-gtk-3.0 gir1.2-harfbuzz-0.0 gir1.2-packagekitglib-1.0 gir1.2-pango-1.0 htop icu-devtools intltool-debian libappstream4 libarchive-cpio-perl libarchive-zip-perl libatk1.0-doc libblkid-dev
libboost-dev libboost1.74-dev libbrotli-dev libcairo-script-interpreter2 libdatrie-dev libdbus-1-dev libdebhelper-perl libdeflate-dev libdevhelp-3-6 libeatmydata1 libegl-dev libegl1-mesa-dev libepoxy-dev libevent-core-2.1-7 libfdisk1
libffi-dev libfile-stripnondeterminism-perl libfontconfig-dev libfontconfig1-dev libfreetype-dev libfreetype6-dev libfribidi-dev libgail-common libgail18 libgl-dev libgles-dev libgles1 libglib2.0-bin libglib2.0-doc libglvnd-core-dev
libglvnd-dev libglx-dev libgraphite2-dev libgtk-3-doc libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz-gobject0 libice-dev libicu-dev libimagequant0 libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-jquery
libjs-jquery-ui libjs-sphinxdoc libjs-underscore liblbfgsb0 liblzma-dev libmail-sendmail-perl libmount-dev libncurses-dev libnetplan0 libnl-3-200 libnl-genl-3-200 libopengl-dev libopengl0 libopenjp2-7 libpackagekit-glib2-18
libpango1.0-doc libpangoxft-1.0-0 libpcre16-3 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpfm4 libpixman-1-dev libpng-dev libpng-tools libpython2-stdlib libpython2.7-minimal
libpython2.7-stdlib libpython3-stdlib libqhull-r8.0 libraqm0 libselinux1-dev libsepol-dev libsm-dev libstemmer0d libsub-override-perl libsys-hostname-long-perl libtcl8.6 libthai-dev libtiff-dev libtiffxx5 libtinfo-dev libtk8.6
libutempter0 libwayland-bin libwayland-dev libxcb-render0-dev libxcb-shm0-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbcommon-dev libxml2-dev libxml2-utils libxmlb2
libxrandr-dev libxrender-dev libxsimd-dev libxtst-dev libyaml-0-2 libz3-4 libz3-dev llvm-14 llvm-14-runtime packagekit packagekit-tools pango1.0-tools po-debconf python-apt-common python-babel-localedata python-matplotlib-data
python-pkg-resources python-setuptools python2 python2-minimal python2.7 python2.7-minimal python3-minimal python3-pip-whl python3-setuptools-whl python3.10 python3.10-dev python3.10-minimal run-one screen tk8.6-blt2.5 tmux
unicode-data uuid-dev wayland-protocols
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
apport* byobu* cloud-guest-utils* cloud-init* command-not-found* devhelp* landscape-client* landscape-common* libatk-bridge2.0-dev* libatk1.0-dev* libatspi2.0-dev* libcairo2-dev* libgdk-pixbuf-2.0-dev* libglib2.0-dev*
libglib2.0-dev-bin* libgtk-3-dev* libgtk2.0-dev* libharfbuzz-dev* libpango1.0-dev* llvm-14-dev* llvm-14-tools* lsb-release* netplan.io* networkd-dispatcher* pastebinit* plymouth-theme-ubuntu-text* python3* python3-appdirs*
python3-apport* python3-apt* python3-attr* python3-automat* python3-babel* python3-backcall* python3-bcrypt* python3-beniget* python3-blinker* python3-brotli* python3-bs4* python3-certifi* python3-cffi-backend* python3-chardet*
python3-click* python3-colorama* python3-commandnotfound* python3-configobj* python3-constantly* python3-cryptography* python3-cycler* python3-dateutil* python3-dbus* python3-debconf* python3-decorator* python3-dev* python3-distro*
python3-distro-info* python3-distupgrade* python3-distutils* python3-fonttools* python3-fs* python3-gast* python3-gdbm* python3-gi* python3-hamcrest* python3-html5lib* python3-httplib2* python3-hyperlink* python3-idna*
python3-importlib-metadata* python3-incremental* python3-ipython* python3-jedi* python3-jeepney* python3-jinja2* python3-json-pointer* python3-jsonpatch* python3-jsonschema* python3-jwt* python3-keyring* python3-kiwisolver*
python3-launchpadlib* python3-lazr.restfulclient* python3-lazr.uri* python3-lib2to3* python3-lxml* python3-lz4* python3-markupsafe* python3-matplotlib* python3-matplotlib-inline* python3-more-itertools* python3-mpmath*
python3-netifaces* python3-newt* python3-numpy* python3-oauthlib* python3-olefile* python3-openssl* python3-packaging* python3-parso* python3-pexpect* python3-pickleshare* python3-pil* python3-pil.imagetk* python3-pip*
python3-pkg-resources* python3-ply* python3-problem-report* python3-prompt-toolkit* python3-ptyprocess* python3-pyasn1* python3-pyasn1-modules* python3-pycurl* python3-pygments* python3-pyparsing* python3-pyrsistent* python3-pythran*
python3-requests* python3-scipy* python3-secretstorage* python3-serial* python3-service-identity* python3-setuptools* python3-six* python3-software-properties* python3-soupsieve* python3-sympy* python3-systemd* python3-tk*
python3-traitlets* python3-twisted* python3-tz* python3-ufolib2* python3-unicodedata2* python3-update-manager* python3-urllib3* python3-venv* python3-wadllib* python3-wcwidth* python3-webencodings* python3-wheel* python3-yaml*
python3-zipp* python3-zope.interface* python3.10-venv* python3.11-venv* software-properties-common* ubuntu-advantage-tools* ubuntu-minimal* ubuntu-pro-client* ubuntu-pro-client-l10n* ubuntu-release-upgrader-core* ubuntu-wsl* ufw*
unattended-upgrades* update-manager-core*
0 upgraded, 0 newly installed, 155 to remove and 21 not upgraded.
40 not fully installed or removed.
After this operation, 548 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 99157 files and directories currently installed.)
Removing cloud-init (24.4.1-0ubuntu0~22.04.1) ...
/var/lib/dpkg/info/cloud-init.prerm: 21: py3clean: not found
dpkg: error processing package cloud-init (--remove):
installed cloud-init package pre-removal script subprocess returned error exit status 127
dpkg: too many errors, stopping
/var/lib/dpkg/info/cloud-init.postinst: 423: 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:
cloud-init
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试图理解这个问题的时间比我愿意承认的要长得多。关于这个问题的帖子也有很多,然而,这些讨论并不足以帮助我理解。
编辑:有人问我我的 Ubuntu 版本。我很想知道还有什么其他方法可以找到它,但是使用时lsb_release -a
出现了以下错误。
-bash: /usr/bin/lsb_release: /usr/bin/python3: bad interpreter: No such file or directory
几天前我运行了sudo apt update && sudo apt upgrade
。从那时起,Google Chrome 就隐藏了选定的文本,而且我无法从 Chrome PDF 阅读器下载 PDF 文件。我已经卸载了 Chrome,完全删除了目录/home/dan/.config/google-chrome/
,然后重新安装了,但问题仍然存在。
我能做些什么?
如何阻止 apt 下载所有架构的二进制文件,但仍然下载所有架构可用的软件包?我们知道如何将其限制为一种架构,但如何阻止所有二进制文件?
例如,我宁愿不相信微软的这些奇怪的软件包:
$ cat /etc/apt/sources.list.d/microsoft-prod.list
deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/ubuntu/24.10/prod oracular main
$ grep '^Package' /var/lib/apt/lists/packages.microsoft.com_ubuntu_24.10_prod_dists_oracular_main_binary-amd64_Packages
Package: mssql-tools18
Package: msodbcsql18
我尝试过,arch=none
但结果是:
Notice: Skipping acquire of configured file 'main/binary-none/Packages' as repository 'https://packages.microsoft.com/ubuntu/24.10/prod oracular InRelease' doesn't support architecture 'none'
清空arch=
更糟糕,因为 apt 完全停止工作:
Error: Malformed entry 1 in list file /etc/apt/sources.list.d/microsoft-prod.list ([option] no value)
Error: The list of sources could not be read.
为了与其他应用程序一起使用,我仍然希望安装packages-microsoft-prod
。/usr/share/doc/packages-microsoft-prod/microsoft-prod.gpg
当然,是否可以设置一个过滤器来仅允许这个唯一的包?
$ grep-aptavail -P packages-microsoft-prod -s Package,Architecture
Package: packages-microsoft-prod
Architecture: all
问题:要安装软件包 A,我必须从源代码构建并安装一些依赖项 B、C 和 D,因为 apt 无法从存储库安装它们。Apt 无法知道我从源代码安装了这些依赖项,因此我使用 dpkg 强制安装,因为我知道依赖项实际上已经安装。现在,当我使用 apt 安装任何其他软件包 E 时,它仍然会出现警告,提示软件包 A 有未满足的依赖项 B、C 和 D。我该如何告诉 apt,查看依赖项 B、C 和 D 是否确实安装在我的系统上,或者停止显示警告?
背景:我在 Raspberry Pi 5 上使用 Ubuntu 24.04LTS。我一直在尝试让 Hailo AI HAT+ 和 Raspberry Pi Camera Module 3 协同工作,就像它们在 Raspberry Pi OS 上一样。这段旅程让我陷入了从源代码构建 Hailort-pcie-drivers、hailort、hailo tappas、Raspberry Pi 的 libcamera 分支和 Raspberry Pi 的 rpicam-apps 的困境。我现在已经让 AI hat 的 rpicam-apps 演示运行起来了,但这样做之后,apt 认为 rpicam-apps-hailo-postprocess 包仍然有未满足的 hailort、libcamera0.4 和 rpicam-apps 依赖项,这些依赖项“无法安装”,并且每次我使用 apt 安装另一个包时仍会显示此警告。
什么是 PDiff 文件以及它们可以做什么?
它们很重要吗?我能做些什么不下载它们吗?
我一直在使用 wine,但效果不太好所以我将其删除了。
之后 Wine 的 7-zip 仍然存在于gnome-menus
(应用程序菜单)我该如何解决这个问题
我已从存储库中删除wine
安装。我已从自己的存储库中main
删除winehq-stable
winehq
如果我输入sudo apt-get remove --purge wine winehq-stable
它说:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'wine' is not installed, so not removed
Package 'winehq-stable' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
我该如何修复它?
我遇到了 apt 返回的错误,经过许多故障排除步骤后,我找不到原因或解决方案。以下是apt update
输出:
$ sudo apt update
Hit:1 https://nvidia.github.io/libnvidia-container/stable/deb/amd64 InRelease
Hit:2 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:3 https://debian.neo4j.com stable InRelease
Hit:4 http://repository.netdata.cloud/repos/stable/ubuntu jammy/ InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://ca.archive.ubuntu.com/ubuntu jammy InRelease
Get:7 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security InRelease [7,568 B]
Hit:8 http://ca.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:9 http://repository.netdata.cloud/repos/repoconfig/ubuntu jammy/ InRelease
Get:10 https://esm.ubuntu.com/apps/ubuntu jammy-apps-updates InRelease [7,456 B]
Hit:11 http://ca.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:12 https://esm.ubuntu.com/infra/ubuntu jammy-infra-security InRelease [7,450 B]
Get:13 https://esm.ubuntu.com/infra/ubuntu jammy-infra-updates InRelease [7,449 B]
Hit:14 https://ppa.launchpadcontent.net/linrunner/tlp/ubuntu jammy InRelease
Fetched 29.9 kB in 1s (20.1 kB/s)
Reading package lists... Done
E: No priority (or zero) specified for pin
该错误表明缺少引脚优先级。我查看了/etc/apt/preferences.d/
。有 3 个文件,并且所有文件都已分配引脚优先级:
$ ll /etc/apt/preferences.d/
total 12K
-rw-r--r-- 1 root root 65 Mar 5 06:20 80netdata
-rw-r--r-- 1 root root 437 Feb 14 2024 ubuntu-pro-esm-apps
-rw-r--r-- 1 root root 429 Feb 14 2024 ubuntu-pro-esm-infra
$ cat /etc/apt/preferences.d/*
Package: *
Pin: origin "repository.netdata.cloud"
Priority: 1000
# This file is used by Ubuntu Pro and supplied by the ubuntu-pro-client
# package. It has no effect if Ubuntu Pro services are not in use since no
# other apt repositories are expected to match o=UbuntuESMApps.
#
# Pin esm-apps packages to a slightly higher value than the default,
# so those are preferred over a non-ESM package from the archive when the
# service is enabled.
Package: *
Pin: release o=UbuntuESMApps
Pin-Priority: 510
# This file is used by Ubuntu Pro and supplied by the ubuntu-pro-client
# package. It has no effect if Ubuntu Pro services are not in use since no
# other apt repositories are expected to match o=UbuntuESM.
#
# Pin esm-infra packages to a slightly higher value than the default,
# so those are preferred over a non-ESM package from the archive when the
# service is enabled.
Package: *
Pin: release o=UbuntuESM
Pin-Priority: 510
至少 3 个月以来,apt 设置方面没有任何变化,最近唯一值得注意的是我apt update & apt upgrade
前一天所做的事情。
我完全不知所措。如果有任何解决方案,我将不胜感激。
我已经gallery-dl
从 apt 安装了,版本是 1.26。我想要一个更新的版本,所以我从 snap 安装。Snap 通知我,我安装的是 1.28 版本。
但是,当我导航到/snap/gallery-dl/current/bin
并运行时./gallery-dl --version
,它仍然报告 1.26 - 与我使用 apt 获得的版本完全相同。当我导航到/snap/bin
,使用该文件夹中的二进制文件运行时,我得到了正确的 1.28。
那么哪个路径是 snap 二进制的正确路径?/snap/bin
或者/snap/PACKAGE_NAME/current/bin
?