harddisk容量少了很多 [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

« 1 (2)


回覆: harddisk容量少了很多
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 179 / 898
MP : 664 / 28641
EXP: 92
離線
延續上面

================================================================================

執行


$ file /usr/bin/vim



顯示


/usr/bin/vim: symbolic link to /etc/alternatives/vim



================================================================================

執行


$ file /etc/alternatives/vim



顯示


/etc/alternatives/vim: symbolic link to /usr/bin/vim.gtk3



================================================================================

可以執行,閱讀相關說明。

$ man update-alternatives

也可以執行下面指令,閱讀簡易說明


$ update-alternatives --help



顯示


Usage: update-alternatives [<option> ...] <command>

Commands:
--install <link> <name> <path> <priority>
[--slave <link> <name> <path>] ...
add a group of alternatives to the system.
--remove <name> <path> remove <path> from the <name> group alternative.
--remove-all <name> remove <name> group from the alternatives system.
--auto <name> switch the master link <name> to automatic mode.
--display <name> display information about the <name> group.
--query <name> machine parseable version of --display <name>.
--list <name> display all targets of the <name> group.
--get-selections list master alternative names and their status.
--set-selections read alternative status from standard input.
--config <name> show alternatives for the <name> group and ask the
user to select which one to use.
--set <name> <path> set <path> as alternative for <name>.
--all call --config on all alternatives.

<link> is the symlink pointing to /etc/alternatives/<name>.
(e.g. /usr/bin/pager)
<name> is the master name for this link group.
(e.g. pager)
<path> is the location of one of the alternative target files.
(e.g. /usr/bin/less)
<priority> is an integer; options with higher numbers have higher priority in
automatic mode.

Options:
--altdir <directory> change the alternatives directory.
--admindir <directory> change the administrative directory.
--log <file> change the log file.
--force allow replacing files with alternative links.
--skip-auto skip prompt for alternatives correctly configured
in automatic mode (relevant for --config only)
--verbose verbose operation, more output.
--quiet quiet operation, minimal output.
--help show this help message.
--version show the version.



================================================================================

執行


$ ls /etc/alternatives/ -1 | grep vi



顯示


eview
evim
gview
gvim
gvimdiff
rgview
rgvim
rview
rvim
vi
vi.1.gz
view
view.1.gz
view.fr.1.gz
view.it.1.gz
view.ja.1.gz
view.pl.1.gz
view.ru.1.gz
vi.fr.1.gz
vi.it.1.gz
vi.ja.1.gz
vim
vimdiff
vi.pl.1.gz
vi.ru.1.gz



================================================================================

執行


$ ls /var/lib/dpkg/alternatives/ -1 | grep vi



顯示


eview
evim
gview
gvim
gvimdiff
rgview
rgvim
rview
rvim
vi
view
vim



================================================================================

執行


$ update-alternatives --get-selections | grep vi



顯示


editor auto /usr/bin/vim.gtk3
eview auto /usr/bin/vim.gtk3
evim auto /usr/bin/vim.gtk3
ex auto /usr/bin/vim.gtk3
gview auto /usr/bin/vim.gtk3
gvim auto /usr/bin/gvim.nvim-qt
gvimdiff auto /usr/bin/vim.gtk3
rgview auto /usr/bin/vim.gtk3
rgvim auto /usr/bin/vim.gtk3
rview auto /usr/bin/vim.gtk3
rvim auto /usr/bin/vim.gtk3
vi auto /usr/bin/vim.gtk3
view auto /usr/bin/vim.gtk3
vim auto /usr/bin/vim.gtk3
vimdiff auto /usr/bin/vim.gtk3




================================================================================

執行


$ update-alternatives --list vim



顯示


/usr/bin/nvim
/usr/bin/vim.basic
/usr/bin/vim.gtk3



================================================================================

執行


$ update-alternatives --query vim



顯示


Name: vim
Link: /usr/bin/vim
Status: auto
Best: /usr/bin/vim.gtk3
Value: /usr/bin/vim.gtk3

Alternative: /usr/bin/nvim
Priority: 30

Alternative: /usr/bin/vim.basic
Priority: 30

Alternative: /usr/bin/vim.gtk3
Priority: 50



================================================================================

執行


$ update-alternatives --display vim



顯示


vim - auto mode
link best version is /usr/bin/vim.gtk3
link currently points to /usr/bin/vim.gtk3
link vim is /usr/bin/vim
/usr/bin/nvim - priority 30
/usr/bin/vim.basic - priority 30
/usr/bin/vim.gtk3 - priority 50



================================================================================

執行


$ sudo update-alternatives --config vim



顯示


There are 3 choices for the alternative vim (providing /usr/bin/vim).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/vim.gtk3    50        auto mode
  1            /usr/bin/nvim        30        manual mode
  2            /usr/bin/vim.basic   30        manual mode
  3            /usr/bin/vim.gtk3    50        manual mode

Press <enter> to keep the current choice[ * ], or type selection number:



這時候作點小實驗,選擇「2」,按下「Enter」,會接著出現下面的訊息


update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in manual mode



================================================================================

再次執行


$ sudo update-alternatives --config vim



顯示


There are 3 choices for the alternative vim (providing /usr/bin/vim).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/vim.gtk3    50        auto mode
  1            /usr/bin/nvim        30        manual mode
* 2            /usr/bin/vim.basic   30        manual mode
  3            /usr/bin/vim.gtk3    50        manual mode

Press <enter> to keep the current choice[ * ], or type selection number:



執行


$ file /usr/bin/vim



顯示


/usr/bin/vim: symbolic link to /etc/alternatives/vim



而「/usr/bin/vim」一樣維持連結到「/etc/alternatives/vim」。

執行


$ file /etc/alternatives/vim



顯示


/etc/alternatives/vim: symbolic link to /usr/bin/vim.basic



目前「/etc/alternatives/vim」連結到「/usr/bin/vim.basic」。

================================================================================

剛剛使用「--config」的方式來設定,下面改用「--set」的方式來設定。

執行


$ sudo update-alternatives --set vim /usr/bin/nvim



顯示


$ update-alternatives: using /usr/bin/nvim to provide /usr/bin/vim (vim) in manual mode



執行


$ update-alternatives --query vim



顯示


Name: vim
Link: /usr/bin/vim
Status: manual
Best: /usr/bin/vim.gtk3
Value: /usr/bin/nvim

Alternative: /usr/bin/nvim
Priority: 30

Alternative: /usr/bin/vim.basic
Priority: 30

Alternative: /usr/bin/vim.gtk3
Priority: 50



執行


$ sudo update-alternatives --config vim



顯示


There are 3 choices for the alternative vim (providing /usr/bin/vim).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/vim.gtk3    50        auto mode
* 1            /usr/bin/nvim        30        manual mode
  2            /usr/bin/vim.basic   30        manual mode
  3            /usr/bin/vim.gtk3    50        manual mode

Press <enter> to keep the current choice[ * ], or type selection number:



執行


$ file /etc/alternatives/vim



顯示


/etc/alternatives/vim: symbolic link to /usr/bin/nvim



目前「/etc/alternatives/vim」連結到「/usr/bin/nvim」。

================================================================================

剛剛上面透過「--config」或是「--set」來設定,
下面改用「--auto」來設定。

執行


$ sudo update-alternatives --auto vim



顯示


update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/vim (vim) in auto mode



執行


$ sudo update-alternatives --query vim



顯示


Name: vim
Link: /usr/bin/vim
Status: auto
Best: /usr/bin/vim.gtk3
Value: /usr/bin/vim.gtk3

Alternative: /usr/bin/nvim
Priority: 30

Alternative: /usr/bin/vim.basic
Priority: 30

Alternative: /usr/bin/vim.gtk3
Priority: 50



================================================================================

待續...

2017/12/17 17:36
應用擴展 工具箱
回覆: harddisk容量少了很多
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 179 / 898
MP : 664 / 28641
EXP: 92
離線
接下來

================================================================================

執行


$ apt-cache showsrc vim-tiny | grep '^Binary:' -B 2



顯示


Package: vim
Format: 3.0 (quilt)
Binary: vim-common, vim-gui-common, vim-runtime, vim-doc, vim-tiny, vim, vim-gtk, vim-gtk3, vim-nox, vim-athena, vim-gnome, xxd



================================================================================

執行


$ apt-cache showsrc vim | grep '^Binary:' -B 2



顯示


Package: vim
Format: 3.0 (quilt)
Binary: vim-common, vim-gui-common, vim-runtime, vim-doc, vim-tiny, vim, vim-gtk, vim-gtk3, vim-nox, vim-athena, vim-gnome, xxd



================================================================================

執行


$ apt-cache showsrc vim-gtk3 | grep '^Binary:' -B 2



顯示


Package: vim
Format: 3.0 (quilt)
Binary: vim-common, vim-gui-common, vim-runtime, vim-doc, vim-tiny, vim, vim-gtk, vim-gtk3, vim-nox, vim-athena, vim-gnome, xxd



================================================================================

上面表示「Binary Package: vim-tiny」,「Binary Package: vim」,「Binary Package: vim-gtk3」。

是由「Soruce Package: vim」,拆分出來的。

這部份的概念,可以從最近的一篇回覆「#4 回覆: Ubuntu17.10升級時出現了問題」來探索起。

================================================================================

待續...

2017/12/17 17:44
應用擴展 工具箱
回覆: harddisk容量少了很多
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 179 / 898
MP : 664 / 28641
EXP: 92
離線
最後再回到

ubuntu_net2016 寫到:
以vim來說,我平常都是用vim這個指令,那是不是代表vim-common 、vim-runtime、vim-tiny都可以刪除? (vim-runtime?,那平常打的vim不是runtim嗎?)



===========================================================================

執行


$ apt-cache show vim-tiny | grep '^Depends:'



顯示


Depends: vim-common (= 2:8.0.0197-4ubuntu5), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libselinux1 (>= 1.32), libtinfo5 (>= 6)



===========================================================================

執行


$ apt-cache show vim | grep '^Depends:'



顯示


Depends: vim-common (= 2:8.0.0197-4ubuntu5), vim-runtime (= 2:8.0.0197-4ubuntu5), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libgpm2 (>= 1.20.4), libpython3.6 (>= 3.6.0~b2), libselinux1 (>= 1.32), libtinfo5 (>= 6)



===========================================================================

執行


$ apt-cache show vim-gtk3 | grep '^Depends:'



顯示


Depends: vim-common (= 2:8.0.0197-4ubuntu5), vim-gui-common (= 2:8.0.0197-4ubuntu5), vim-runtime (= 2:8.0.0197-4ubuntu5), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libcairo2 (>= 1.4.10), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.37.3), libgpm2 (>= 1.20.4), libgtk-3-0 (>= 3.21.5), libice6 (>= 1:1.0.0), liblua5.2-0, libpango-1.0-0 (>= 1.37.5), libpangocairo-1.0-0 (>= 1.14.0), libperl5.26 (>= 5.26.0~rc1), libpython3.6 (>= 3.6.0~b2), libselinux1 (>= 1.32), libsm6, libtcl8.6 (>= 8.6.0), libtinfo5 (>= 6), libx11-6, libxt6



===========================================================================

執行


$ sudo apt-get remove vim-common



顯示


Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  vim-gui-common vim-runtime
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  ubuntu-minimal vim vim-common vim-gtk3 vim-tiny
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 7,011 kB disk space will be freed.
Do you want to continue? [Y/n]



當嘗試要移除「vim-common」這個套件,

會一併移除「ubuntu-minimal」 ,「vim」 ,「vim-gtk3」,「vim-tiny」這幾個套件。


===========================================================================

或是加上「-s」或「--simulate」來觀察「apt-get remove vim-common」會執行那些動作,


$ sudo apt-get remove -s vim-common



顯示


Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  vim-gui-common vim-runtime
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  ubuntu-minimal vim vim-common vim-gtk3 vim-tiny
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
Remv ubuntu-minimal [1.404.1]
Remv vim [2:8.0.0197-4ubuntu5]
Remv vim-tiny [2:8.0.0197-4ubuntu5]
Remv vim-gtk3 [2:8.0.0197-4ubuntu5]
Remv vim-common [2:8.0.0197-4ubuntu5]



===========================================================================

另外有一個指令「aptitude」,我比較少用,只是我個人的習慣,沒什麼特別的因素。


$ aptitude -v --show-summary why vim-common



顯示


Packages requiring vim-common:
  asciidoc
  vim
  vim-common
  vim-gtk3
  vim-tiny



===========================================================================

使用「#3」提到的「deborphan」。

林博仁 寫到:
可以用 Deborphan 軟體查看有哪些不再用到的軟體包


執行下面指令,安裝「deborphan」這個套件。


$ sudo apt-get install deborphan



執行下面指令,閱讀相關的說明


$ man deborphan



執行下面指令


$ deborphan vim-common



顯示


vim-common
      vim-tiny
      vim
      vim-gtk3



===========================================================================

關於

ubuntu_net2016 寫到:
(vim-runtime?,那平常打的vim不是runtim嗎?)



除了可以參考上面幾個回覆要表達的一些概念。

也可以執行下面指令,觀察「vim-runtime」這個套件,包含了那些檔案


$ dpkg -L vim-runtime



===========================================================================

關於「#4」您提到的發問,
關於「發問1」和「發問2」,我就沒有去探索,來回答您的問題,
也許您可以藉由上面我提到的幾個回覆

* 「#5
* 「#6
* 「#7
* 「#8
* 「#9
* 「#10
* 「#11
* 「#12

建立一些基礎概念後,然後您再自行去探索,也許您能找到您原本想要問的答案。

探索過程中,一樣可以再參考「[索引] 套件操作實務」。

===========================================================================

$ man apt
$ man apt-get
$ man apt-cache
$ man dpkg
$ man aptitude
$ man deborphan

===========================================================================

執行


$ apt



顯示


apt 1.5.1 (amd64)
Usage: apt [options] command

apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.

Most used commands:
  list - list packages based on package names
  search - search in package descriptions
  show - show package details
  install - install packages
  remove - remove packages
  autoremove - Remove automatically all unused packages
  update - update list of available packages
  upgrade - upgrade the system by installing/upgrading packages
  full-upgrade - upgrade the system by removing/installing/upgrading packages
  edit-sources - edit the source information file

See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
                                        This APT has Super Cow Powers.




===========================================================================

執行


$ apt-get



顯示


apt 1.5.1 (amd64)
Usage: apt-get [options] command
       apt-get [options] install|remove pkg1 [pkg2 ...]
       apt-get [options] source pkg1 [pkg2 ...]

apt-get is a command line interface for retrieval of packages
and information about them from authenticated sources and
for installation, upgrade and removal of packages together
with their dependencies.

Most used commands:
  update - Retrieve new lists of packages
  upgrade - Perform an upgrade
  install - Install new packages (pkg is libc6 not libc6.deb)
  remove - Remove packages
  purge - Remove packages and config files
  autoremove - Remove automatically all unused packages
  dist-upgrade - Distribution upgrade, see apt-get(8)
  dselect-upgrade - Follow dselect selections
  build-dep - Configure build-dependencies for source packages
  clean - Erase downloaded archive files
  autoclean - Erase old downloaded archive files
  check - Verify that there are no broken dependencies
  source - Download source archives
  download - Download the binary package into the current directory
  changelog - Download and display the changelog for the given package

See apt-get(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
                                        This APT has Super Cow Powers.




===========================================================================

執行


$ apt-cache



顯示


apt 1.5.1 (amd64)
Usage: apt-cache [options] command
       apt-cache [options] show pkg1 [pkg2 ...]

apt-cache queries and displays available information about installed
and installable packages. It works exclusively on the data acquired
into the local cache via the 'update' command of e.g. apt-get. The
displayed information may therefore be outdated if the last update was
too long ago, but in exchange apt-cache works independently of the
availability of the configured sources (e.g. offline).

Most used commands:
  showsrc - Show source records
  search - Search the package list for a regex pattern
  depends - Show raw dependency information for a package
  rdepends - Show reverse dependency information for a package
  show - Show a readable record for the package
  pkgnames - List the names of all packages in the system
  policy - Show policy settings

See apt-cache(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).




===========================================================================

以上提供參考

報告完畢


2017/12/17 17:56
應用擴展 工具箱

« 1 (2)

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.