Yos*_*syp 5 linux dpkg linux-mint
为什么dpkg -S某些命令会产生标题错误?
例如:
dpkg -S /usr/bin/firefox
firefox: /usr/bin/firefox
Run Code Online (Sandbox Code Playgroud)
但接下来这个:
dpkg -S /usr/bin/ls
dpkg-query: no path found matching pattern /usr/bin/ls
Run Code Online (Sandbox Code Playgroud)
A.B*_*A.B 10
合并需要数年时间才能实现,并且仍在进行中/usr。特别是今天:
bash,base-files,coreutils,dash,glibc,util-linux不应将文件从 移动/到/usr:
- 这些包的上传需要同步。
ls曾经是“重要”命令的一部分,而/bin不是/usr/bin. 现在/bin只是一个符号链接/usr/bin:
$ ls -ld /bin /sbin
lrwxrwxrwx 1 root root 7 Nov 17 2020 /bin -> usr/bin
lrwxrwxrwx 1 root root 8 Nov 17 2020 /sbin -> usr/sbin
Run Code Online (Sandbox Code Playgroud)
差异不是很明显。通常的PATH环境变量是(我稍微修剪了一下):
$ printenv PATH
/usr/local/bin:/usr/bin:/bin
Run Code Online (Sandbox Code Playgroud)
/usr/bin/ls/bin/ls即使两个路径都提供该命令,也会在之前找到。
然而,提供该命令的软件包ls仍然将其安装在/bin/lsDebian、Ubuntu 和 Linux Mint 中(后者是前者的衍生版本)。最后,因为符号链接,就变成了/usr/bin/ls。因为这:
$ dpkg -S /usr/bin/ls
dpkg-query: no path found matching pattern /usr/bin/ls
$ dpkg -S /bin/ls
coreutils: /bin/ls
Run Code Online (Sandbox Code Playgroud)
因此,您必须在两个路径中搜索/usr/bin. 同样对于/sbin, /usr/sbin. 历史上被认为足以将系统引导到可以在需要时安装的状态的“基本”命令最终将在和/usr中找到,其他命令在和中找到。/bin/sbin/usr/bin/usr/sbin
人们可以想象,在 Debian、Ubuntu 和 Linux Mint 的未来(但未知)版本中,将完成从/到安装的各种软件包的同步移动,然后给出结果而不是./usrdpkg -S /usr/bin/lsdpkg -S /bin/ls
小智 1
dpkg -S /usr/bin/ls不起作用,因为ls命令是别名命令。要检查这一点,您可以使用以下命令:
$ type -t ls\nalias\n\n$ type -a ls\nls is aliased to `ls --color=auto'\nls is /usr/bin/ls\nls is /bin/ls\nRun Code Online (Sandbox Code Playgroud)\nlscommand 属于包含coreutils很多基本命令的包:
\n\narch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp\ncsplit cut date dd df dir dircolors dirname du echo env Expand expr\nfactor false fancy fmt Fold groups head hostid id install join link ln\nlogname ls md5sum mkdir mkfifo mknod mktemp mv Nice nl nohup nproc numfmt\nod Paste pathchk Pinky pr printenv printf ptx pwd readlink realpath rm\nrmdir runcon sha*sum seq shred sleep sort split stat stty sumsync tac\ntail tee test timeout touch tr true truncate tsort tty uname unexpand\nuniq 取消链接用户vdir 厕所 who whoami 是的
\n
dpkg -S将与:
$ dpkg -S /bin/ls\ncoreutils: /bin/ls\nRun Code Online (Sandbox Code Playgroud)\ntouch所有基本 Linux 命令( 、mv、cp、mkdir等\xe2\x80\xa6)的行为都是相同的dd。
| 归档时间: |
|
| 查看次数: |
366 次 |
| 最近记录: |