为何lxde-core推荐lxterminal但安装时不提示会安装?

最大的社区版本,Ubuntu的发源地
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#16

帖子 poloshiao » 2017-05-07 7:11

第一次
每件事 都有第一次
讚賞你的勇氣

建議
註冊個帳號
以後可以常常來練習英文
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#17

帖子 poloshiao » 2017-05-07 7:17

也許 跟 priority 設定 有關
https://manpages.debian.org/jessie/apt/ ... .5.en.html
但是 還沒找到 簡單易懂 的中文描述 可以提供給你

詳細參閱

https://manpages.debian.org/jessie/apt/ ... .8.en.html
apt-get - APT package handling utility -- command-line interface
install
Finally, the apt_preferences(5) mechanism allows you to create an alternative installation policy for individual packages.

https://manpages.debian.org/jessie/apt/ ... .5.en.html
apt_preferences - Preference control file for APT
How APT Interprets Priorities
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#18

帖子 科学之子 » 2017-05-07 21:37

poloshiao 写了:也許 跟 priority 設定 有關
https://manpages.debian.org/jessie/apt/ ... .5.en.html
但是 還沒找到 簡單易懂 的中文描述 可以提供給你

詳細參閱

https://manpages.debian.org/jessie/apt/ ... .8.en.html
apt-get - APT package handling utility -- command-line interface
install
Finally, the apt_preferences(5) mechanism allows you to create an alternative installation policy for individual packages.

https://manpages.debian.org/jessie/apt/ ... .5.en.html
apt_preferences - Preference control file for APT
How APT Interprets Priorities
https://manpages.debian.org/jessie/apt/ ... html#FILES
没有相关文件,猜测是默认状态
Several versions of a package may be available for installation when the sources.list(5) file contains references to more than one distribution (for example, stable and testing). APT assigns a priority to each version that is available. Subject to dependency constraints, apt-get selects the version with the highest priority for installation. The APT preferences override the priorities that APT assigns to package versions by default, thus giving the user control over which one is selected for installation.
貌似是"混源"(sources.list包含多个发行版的源)时才有用
我这里的安装环境是debootstrap安装,然后chroot进去,不存在混源的问题
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#19

帖子 poloshiao » 2017-05-08 6:22

为何lxde-core推荐lxterminal但安装时不提示会安装?
參閱
1. http://www.linuxquestions.org/questions ... es-607670/
How to force aptitude to install recommended packages?
1-1. 不是建議你強制安裝 而是看看它如何安排強制安裝 能否給你一點點提示

2. https://aptitude.alioth.debian.org/doc/ ... 05s05.html
Configuration file reference
Prev Customizing aptitude
2-1. 使用 recommend 及 install 字串搜尋上面的文章 看看 有沒有共同的部份
2-2. 特別是 這兩個 Options
Option: Aptitude::Auto-Install
Option: APT::Install-Recommends
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#20

帖子 poloshiao » 2017-05-08 11:28

aptitude -P install -r lxde-core:
1. -p
1-1. https://www.debian.org/doc/manuals/apti ... 01.en.html
-P, --prompt
Always display a prompt before downloading, installing or removing packages, even when no actions other than those explicitly requested will be performed.
This corresponds to the configuration option Aptitude::CmdLine::Always-Prompt.
1-1-1. https://www.debian.org/doc/manuals/apti ... ml#idm6654
Option: Aptitude::CmdLine::Always-Prompt
Default: false
Description: In command-line mode, if this is set, aptitude will always prompt before starting to install or remove packages, even if the prompt would normally be skipped. This is equivalent to the -P command-line option.

2. -r
2-1. https://www.debian.org/doc/manuals/apti ... 01.en.html
-r, --with-recommends
Treat recommendations as dependencies when installing new packages (this overrides settings in /etc/apt/apt.conf and ~/.aptitude/config).
This corresponds to the configuration option APT::Install-Recommends
2-1-1. https://www.debian.org/doc/manuals/apti ... ml#idm6654
Option: Aptitude::Auto-Install
Default: true
Description: If this option is true, aptitude will automatically attempt to fulfill the dependencies of a package when you mark a package to be installed or upgraded.
2-1-2. https://www.debian.org/doc/manuals/apti ... ml#idm6654
Option: APT::Install-Recommends
Default: true
Description: If this option is true and Aptitude::Auto-Install is true, then whenever you mark a package for installation, aptitude will also mark the packages it recommends for installation. Furthermore, if this option is true, aptitude will not consider packages to be unused (and thus will not automatically remove them) as long as any installed package reommends them. For more information, see the section called “Managing automatically installed packages” and the section called “Immediate dependency resolution”.
2-1-2-1. https://www.debian.org/doc/manuals/apti ... 02.en.html
Immediate dependency resolution
Whenever you choose to install or upgrade a package in aptitude, aptitude makes an immediate attempt to resolve any of its dependencies that are not fulfilled. For each unsatisfied dependency (either a “Depends”, a “recommends”, or a “Conflicts”), it performs the following steps:
If the dependency is a recommendation, aptitude tries to guess whether it is a “new” recommendation or a “previously satisfied” recommendation. aptitude considers a recommendation to be “new” if the package declaring the recommendation is not currently installed, or if its installed version does not recommend a package of the same name. On the other hand, a recommendation is “previously satisfied” if the package declaring the recommendation is installed, the currently installed version recommends a package of the same name, and that recommendation is currently fulfilled.
For example: suppose that version 1.0 of prog recommends version 4.0 of libcool1, but version 2.0 of prog recommends version 5.0 of libcool1, and also recommends apache. If you choose to upgrade prog from version 1.0 to version 2.0, the recommendation of apache will be considered to be “new” because version 1.0 of prog did not recommend apache. On the other hand, the recommendation of libcool1 is not “new”, because version 1.0 of prog recommended libcool1, even though it recommended a different version. However, if libcool1 is installed, then that recommendation will be considered to be “previously satisfied”.
If the configuration option APT::Install-recommends is true, aptitude will always attempt to fulfill “new” and “previously satisfied” recommendations; all others will be ignored by immediate resolution. If that option is false, immediate dependency resolution will ignore all recommendations.
2-1-2-2. 注意 最後一句話
If the configuration option APT::Install-recommends is true, ....
If that option is false, ...
兩者處理方式 不同
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#21

帖子 科学之子 » 2017-05-09 13:44

poloshiao 写了:
为何lxde-core推荐lxterminal但安装时不提示会安装?
參閱
1. http://www.linuxquestions.org/questions ... es-607670/
How to force aptitude to install recommended packages?
1-1. 不是建議你強制安裝 而是看看它如何安排強制安裝 能否給你一點點提示

2. https://aptitude.alioth.debian.org/doc/ ... 05s05.html
Configuration file reference
Prev Customizing aptitude
2-1. 使用 recommend 及 install 字串搜尋上面的文章 看看 有沒有共同的部份
2-2. 特別是 這兩個 Options
Option: Aptitude::Auto-Install
Option: APT::Install-Recommends
poloshiao 写了:2. -r
2-1. https://www.debian.org/doc/manuals/apti ... 01.en.html
-r, --with-recommends
Treat recommendations as dependencies when installing new packages (this overrides settings in /etc/apt/apt.conf and ~/.aptitude/config).
This corresponds to the configuration option APT::Install-Recommends
@poloshiao
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#22

帖子 poloshiao » 2017-05-09 14:25

(this overrides settings in /etc/apt/apt.conf and ~/.aptitude/config).
所謂 overrides
猜測 應該針對 同一個 參數 Option
不同參數 應該還是有效
意思是
/etc/apt/apt.conf 及 ~/.aptitude/config
中 不同參數的 參數值
還是需要檢驗看看
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#23

帖子 科学之子 » 2017-05-09 15:47

poloshiao 写了:
(this overrides settings in /etc/apt/apt.conf and ~/.aptitude/config).
所謂 overrides
猜測 應該針對 同一個 參數 Option
不同參數 應該還是有效
意思是
/etc/apt/apt.conf 及 ~/.aptitude/config
中 不同參數的 參數值
還是需要檢驗看看
在测试环境中相关配置文件不存在
/etc/apt/apt.conf.d
里面的文件也没有发现与recommend相关的选项
测试环境是用debootstrap新安装的(stretch,jessie)基本系统

Tue May 9 15:52:08 CST 2017补充:
另外很多recommend都会被正常提示
我不确定是否仅仅只是lxterminal不被提示,也许在递归过程中还有其它像lxterminal一样不被提示但没能发现
@poloshiao
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#24

帖子 poloshiao » 2017-05-09 16:08

在测试环境中相关配置文件不存在
/etc/apt/apt.conf.d
里面的文件也没有发现与recommend相关的选项
测试环境是用debootstrap新安装的(stretch,jessie)基本系统
https://www.debian.org/doc/manuals/apti ... ml#idm6624
Locations of configuration files
aptitude's configuration is read from the following sources, in order:
1. Configuration file options specified on the command-line.
2. The user's configuration file, ~/.aptitude/config. This file is overwritten when the user modifies settings in the Options menu.
3. The system configuration file, /etc/apt/apt.conf.
4. The system configuration fragment files, /etc/apt/apt.conf.d/*.
5. The file specified by the APT_CONFIG environment variable (if any).
6. Default values stored in /usr/share/aptitude/aptitude-defaults.
7. Default values built into aptitude.

When an option is being checked, these sources are searched in order, and the first one that provides a value for the option is used.
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#25

帖子 vickycq » 2017-05-18 1:43

vickycq 写了: 用一台无头服务器试了试,无法重现您的情况
@科学之子
实际上,这台无头服务器是 Debian 8。当按照您的步骤使用 debootstrap 安装了 Debian 9 的最小系统后,可以重现您的问题。实际上,发现了几个疑点,但还没有完全搞明白:

1. 在 apt.conf 中设置

代码: 全选

Aptitude::CmdLine::Verbose "2";
然后运行

代码: 全选

aptitude --show-why install lxde-core > termit-debug
会生成一个约 160 MiB 的详细匹配过程。您会发现,其中试图匹配 lxterminal 的条目全部为 "skipping, parent is not the selected version"。当我在 aptitude 源代码中加入 debug 输出测试时,发现匹配 lxterminal 时 selected_version(dep.ParentPkg()) 的值为 0。不明白这是什么意思,可能是 lxterminal 根本没被“选择”。


2. 使用 equivs 创建一个空软件包,使其 Recommends: lxterminal | x-terminal-emulator,然后到基本系统中安装之,发现可以安装 lxterminal。
然后,使用 equivs 再创建一个空软件包,使其 Recommends: x-terminal-emulator,即出现 "virtual-package-depends-without-real-package-depends" 问题,此时会安装 termit。
从这个实验可以看出,问题可能在于一个特殊的依赖链使得不必再安装 lxteminal,因为 x-terminal-emulator 已经在之前的匹配中被满足了。问题和那个 lintian 页面一样:当只依赖虚包时,如何确定选择哪个软件包。


3. 实际上,由于您发现了 “lxpanel 只推荐虚包”,您已经非常接近解决这个问题。但当我修改 lxde-core 的依赖,去掉 'lxpanel',再重新打包实验,发现还是会安装 termit。可能还有其它没揪出来的。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#26

帖子 科学之子 » 2017-05-18 14:30

@vickycq
vickycq 写了:但当我修改 lxde-core 的依赖,去掉 'lxpanel',再重新打包实验,发现还是会安装 termit。
可能像poloshiao在本帖其它楼层说的,多个不同的包可能会存在版本混淆?
vickycq 写了:可能还有其它没揪出来的。
我不确定,但是我把aptitude -P -r lxde-core输出的"即将安装"列表传给"aptitude show"
输出结果里搜索"x-terminal-emulator",只有lxce-core,lxpanel,termit,这三个
Consider that Jessie's lxpanel package does not list any terminal emulator as its recommends, the above thoery actually made sense to me.
在jessie也不太正常,本来lxterminal是自动安装的,却被标记为手动安装了(我用aptitude看到的,没用apt-mark确认)
不过jessie也快失去支持了,所以我们应该把注意力优先放在解决stretch的问题上?
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#27

帖子 vickycq » 2017-05-18 18:18

科学之子 写了:我不确定,但是我把aptitude -P -r lxde-core输出的"即将安装"列表传给"aptitude show"输出结果里搜索"x-terminal-emulator",只有lxce-core,lxpanel,termit,这三个
昨天犯迷糊了,虽然已经“修改 lxde-core 的依赖,去掉 'lxpanel'”,但由于其它 lxde 核心组件的依赖,lxpanel 仍然会被安装,从而出现相同现象。因此,基本上可以确定就是 lxpanel 的问题。

不过对“不遵循 lintian 规范”报 bug 是否合适,还不确定。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#28

帖子 科学之子 » 2017-05-20 16:55

科学之子 写了: 在jessie也不太正常,本来lxterminal是自动安装的,却被标记为手动安装了(我用aptitude看到的,没用apt-mark确认)
不过jessie也快失去支持了,所以我们应该把注意力优先放在解决stretch的问题上?
刚刚试了试,用debootstrap最小化安装一个jessie,然后把sources.list改成stretch的
类似问题仍然存在于jessie,据此猜测可能跟"包控制文件"无关
这次我发现的是jessie的lxde-core依赖lxpanel
但是装上之后lxpanel被标记为手动安装
不确定具体原因,但并非所有的直接依赖都被标记为手动,例如openbox就仍被标记为自动

如果是stretch的最小系统就没这个问题(至少在同样的测试中没发现)
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#29

帖子 科学之子 » 2017-11-16 4:32

equivs 创建空包后如何安装recommends?
或者说安装方式是什么?
我这里dpkg -i貌似不装recommends
vickycq 写了:2. 使用 equivs 创建一个空软件包,使其 Recommends: lxterminal | x-terminal-emulator,然后到基本系统中安装之,发现可以安装 lxterminal。
然后,使用 equivs 再创建一个空软件包,使其 Recommends: x-terminal-emulator,即出现 "virtual-package-depends-without-real-package-depends" 问题,此时会安装 termit。
从这个实验可以看出,问题可能在于一个特殊的依赖链使得不必再安装 lxteminal,因为 x-terminal-emulator 已经在之前的匹配中被满足了。问题和那个 lintian 页面一样:当只依赖虚包时,如何确定选择哪个软件包。
@vickycq
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 为何lxde-core推荐lxterminal但安装时不提示会安装?

#30

帖子 vickycq » 2017-11-16 12:06

科学之子 写了:equivs 创建空包后如何安装recommends?或者说安装方式是什么?我这里dpkg -i貌似不装recommends
到 deb 包所在目录下 使用 apt install ./XXX.deb 试试(注意要带路径 ./)
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
回复