管理从源码安装的应用的link——stow

An Easy Way To Remove Programs Installed From Source In Linux

https://www.ostechnix.com/an-easy-way-to-remove-programs-installed-from-source-in-linux/

Install Position(take neovim as example)

/usr/local/stow/nvim/

Make Symbolic Link

cd /usr/local/stow/
sudo stow nvim

This command will make some link files at /usr/local/bin/, pointing to all the files in /usr/local/stow/nvim/bin and /usr/local/share/, pointing to all the files in /usr/local/stow/nvim/share and so on.

Example

For example, After make install, there will be nvim in /usr/local/stow/nvim/bin/, you could make a link file (like vim) in this directory, like following,

  ➜  ll /usr/local/stow/nvim/bin
 total 16M
drwxr-sr-x 2 root staff 4.0K xxx xx xx:xx .
drwxr-sr-x 5 root staff 4.0K xxx xx xx:xx ..
-rwxr-xr-x 1 root staff  16M xxx xx xx:xx nvim
lrwxrwxrwx 1 root staff    4 xxx xx xx:xx vim -> nvim

 ➜  ll /usr/local/stow/nvim/share
total 28K
drwxr-sr-x  7 root staff 4.0K xxx xx xx:xx .
drwxr-sr-x  5 root staff 4.0K xxx xx xx:xx ..
drwxr-sr-x  2 root staff 4.0K xxx xx xx:xx applications
drwxr-sr-x 31 root staff 4.0K xxx xx xx:xx locale
drwxr-sr-x  3 root staff 4.0K xxx xx xx:xx man
drwxr-sr-x  3 root staff 4.0K xxx xx xx:xx nvim
drwxr-sr-x  2 root staff 4.0K xxx xx xx:xx pixmaps

and then stow it

  ➜  ll /usr/local/bin
total 8.0K
drwxr-xr-x  2 root root 4.0K xxx xx xx:xx .
drwxr-xr-x 11 root root 4.0K xxx xx xx:xx ..
lrwxrwxrwx  1 root root   21 xxx xx xx:xx nvim -> ../stow/nvim/bin/nvim
lrwxrwxrwx  1 root root   20 xxx xx xx:xx vim -> ../stow/nvim/bin/vim

  ➜  ll /usr/local/share
total 24K
drwxr-xr-x  6 root root  4.0K xxx xx xx:xx .
drwxr-xr-x 11 root root  4.0K xxx xx xx:xx ..
lrwxrwxrwx  1 root root    31 xxx xx xx:xx applications -> ../stow/nvim/share/applications
lrwxrwxrwx  1 root root    25 xxx xx xx:xx locale -> ../stow/nvim/share/locale
drwxr-xr-x  2 root root  4.0K xxx xx xx:xx man
lrwxrwxrwx  1 root root    23 xxx xx xx:xx nvim -> ../stow/nvim/share/nvim
lrwxrwxrwx  1 root root    26 xxx xx xx:xx pixmaps -> ../stow/nvim/share/pixmaps

  ➜  ll /usr/local/share/man
total 8.0K
drwxr-xr-x 2 root root 4.0K xxx xx xx:xx .
drwxr-xr-x 6 root root 4.0K xxx xx xx:xx ..
lrwxrwxrwx 1 root root   30 xxx xx xx:xx man1 -> ../../stow/nvim/share/man/man1

Remove Symbolic Link

sudo stow --delete neovim
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值