You are not logged in.

#1 2017-03-08 16:10:13

billodwyer
Member
Registered: 2013-06-15
Posts: 18

[Solved] Workaround/Fix for binaries being replaced after update

So in order to have vim replace vi with vim globally (ie. for when I'm using sudo vi) I did the following:

mv /usr/bin/vi /usr/bin/vi.old
ln -s /usr/bin/vim /usr/bin/vi

And similarly with the rename command:

mv /usr/bin/rename /usr/bin/rename.old
ln -s /usr/bin/file-rename /usr/bin/rename

This was broken by an update to core-utils, and I was wondering if there's any way around this? I don't want to stop updating, and obviously it's not a huge issue to run those four commands again, but just wanted to know if there's anything I can do to either automate these commands after an update to core-utils, or stop the binary being replaced?

Last edited by billodwyer (2017-03-08 16:51:34)

Offline

#2 2017-03-08 16:13:50

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,097

Re: [Solved] Workaround/Fix for binaries being replaced after update

Put the symlink in /usr/local/bin

Offline

#3 2017-03-08 16:18:23

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,842
Website

Re: [Solved] Workaround/Fix for binaries being replaced after update

There is also vi-vim-symlink in the AUR, which replaces core/vi

Out of interest though, why are you doing "sudo vi" if you mean "sudo vim"? Habit? Or do you want vim to behave like vi?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2017-03-08 16:45:09

billodwyer
Member
Registered: 2013-06-15
Posts: 18

Re: [Solved] Workaround/Fix for binaries being replaced after update

@arojas! Oh my God, I'm a moron. Thank you!

@WorMzy It's mostly just force of habit at this point, when I was using Ubuntu sudo vi didn't behave like vanilla vi does (it was close to, but not exactly vim), and I got used to it. Pretty lazy at this point I know, but I'm set in my ways big_smile

Offline

#5 2017-03-08 20:06:06

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Workaround/Fix for binaries being replaced after update

Why not just use aliases, that's what I do.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2017-03-08 20:10:29

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [Solved] Workaround/Fix for binaries being replaced after update

slithery wrote:

Why not just use aliases, that's what I do.

$ alias ll='ls -l'
$ ll
total 48K
drwxr-xr-x 38 ayekat ayekat 4.0K 2017-03-07 22:57 dev
drwxr-xr-x  8 ayekat ayekat 4.0K 2017-03-01 08:46 media
drwxr-xr-x  5 ayekat ayekat 4.0K 2016-07-29 19:32 nodes
drwxr-xr-x 13 ayekat ayekat 4.0K 2016-11-28 09:27 rl
drwxr-xr-x  5 ayekat ayekat  24K 2017-03-08 00:09 tmp
$ sudo ll
[sudo] password for ayekat:
sudo: ll: command not found

pkgshackscfgblag

Offline

#7 2017-03-08 20:20:25

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Workaround/Fix for binaries being replaced after update

I have roots ~/.bash_aliases symlinked to my own users so the above works in my case.

Last edited by Slithery (2017-03-08 20:22:22)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#8 2017-03-08 20:33:46

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [Solved] Workaround/Fix for binaries being replaced after update

slithery wrote:

I have roots ~/.bash_aliases symlinked to my own users so the above works in my case.

yikes

Although... we are talking about putting stuff into /usr/local to work around one user not wanting to adapt and type `sudo vim` instead of `sudo vi`, so I guess this is about a single-user setup anyway.

For general (multi-user) setups, the cleanest approach would probably be a user-specific directory (e.g. ~/.local/bin) added to `$PATH`, and putting the symlink in there. Works with sudo, too. And has the nice benefit of only affecting your own user.


pkgshackscfgblag

Offline

#9 2017-03-13 00:46:11

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] Workaround/Fix for binaries being replaced after update

In a similar case, I have replaced /bin/sh with a symlink to dash.

I ensure it survives updates to bash, using a pacman hook as I documented on the ArchWiki dash page.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB