Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bd not working #Ubuntu16.04 #32

Closed
ousodaniel opened this issue Apr 15, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@ousodaniel
Copy link

commented Apr 15, 2017

I can't quite get this "bd" thing going, what wrong did I do, see code...

ousodanos@ousodanos-UX360CA:/usr/bin$ chmod +rx bd
chmod: changing permissions of 'bd': Operation not permitted
ousodanos@ousodanos-UX360CA:/usr/bin$ sudo chmod +rx bd
ousodanos@ousodanos-UX360CA:/usr/bin$ sudo echo 'alias bd=". bd -s"' >> /.bashrc
ousodanos@ousodanos-UX360CA:/usr/bin$ source /.bashrc
ousodanos@ousodanos-UX360CA:/usr/bin$ cd
ousodanos@ousodanos-UX360CA:
$ sudo wget -o /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd
ousodanos@ousodanos-UX360CA:
$ sudo source /etc/bash_completion.d/bd
sudo: source: command not found
ousodanos@ousodanos-UX360CA:$ source /etc/bash_completion.d/bd
--2017-04-15: command not found
bash: /etc/bash_completion.d/bd: line 2: syntax error near unexpected token (' bash: /etc/bash_completion.d/bd: line 2: Resolving raw.github.com (raw.github.com)... 151.101.172.133'
ousodanos@ousodanos-UX360CA:
$ cd Downloads/LibreOffice_5.3.2.2_Linux_x86-64_deb/DEBS/
ousodanos@ousodanos-UX360CA:/Downloads/LibreOffice_5.3.2.2_Linux_x86-64_deb/DEBS$ bd Downloads
--2017-04-15: command not found
bash: /usr/bin/bd: line 2: syntax error near unexpected token (' bash: /usr/bin/bd: line 2: Resolving raw.github.com (raw.github.com)... 151.101.172.133'
ousodanos@ousodanos-UX360CA:
/Downloads/LibreOffice_5.3.2.2_Linux_x86-64_deb/DEBS$

I'd really appreciate a quick response here, thanks

@hackel

This comment has been minimized.

Copy link

commented Apr 16, 2017

Jesus, are you sure you even know enough to be using a tool like this?

First off, ignore the author's instructions and copy the bd binary into /usr/local/bin. Never touch /usr/* other than through a package manager.

Second, do you even understand what sudo does? You should not be using it to write to your own config files, nor to source other bash scripts running as your own user. source is a bash builtin command, not an executable, that's why you can't run it with sudo.

Third, you are using -o instead of -O (capitalized) as your argument to wget, which means you are saving wget's output to that file, and then trying to source it as a bash script.

I don't mean to be so harsh, and I hope you're learning something from all of this, but this is seriously pretty basic stuff. bd is the kind of thing that you really should only have the need to use once you've already mastered all the basics. Good luck.

@rautamiekka

This comment has been minimized.

Copy link

commented Apr 16, 2017

@hackel No, you're not harsh, you're merely stating what he's doing wrong; it's obvious he doesn't know what he's doing, but we all were beginners.

@rautamiekka

This comment has been minimized.

Copy link

commented Apr 16, 2017

Ok, let's fix what mistakes were made. You need to copypaste directly so you won't make a mistake, and remember that the letter case and spacing matters:

  1. Delete the .bashrc created to filesystem root: sudo rm --verbose /.bashrc. Even if you made the mistake of having a space after / with that command, the system won't be touched since the filesystem root, represented by /, is considered a folder, which rm refuses to touch unless you provide either -r or --recursive (Bash should complain about such mistake, but there's no guaranteeing it will).
  2. Delete the Bash completion file that's now a log file: sudo rm --verbose /etc/bash_completion.d/bd
  3. Remove the alias from the currently open terminal (either close all terminal windows or run this in all of them to rid of it): unalias bd

Normally it's not advisable, but given this script doesn't look like it'd get updated anytime soon, and since it's not packaged for Ubuntu yet, but Ubuntu is based on Debian Unstable anyway, downloading the DEB from Debian should be the best way. Debian packages are compatible with Ubuntu, but in some cases not the other way around.

1) Download the DEB to your downloads folder (it's a single line of code):

wget -O ~/Downloads/bd_1.02-1_all.deb http://ftp.de.debian.org/debian/pool/main/b/bd/bd_1.02-1_all.deb

(it's one of the links from https://packages.debian.org/sid/all/bd/download, the first European one I pick)
2) Install the DEB: sudo dpkg -i ~/Downloads/bd_1.02-1_all.deb

@vigneshwaranr pointed out my apparent failure to check packages.ubuntu.com for bd, an embarrasing failure at that. Since it's in the repos (you need to enable the Universe repo), you don't need to install Debian's package of it. Read the 'On another note' section below how to install it.

Now you can uninstall and update bd easily.

On another note

You have a LibreOffice download in there, which is also doing things the wrong way. On a Linux distro like Ubuntu where most stuff is installed from the repos, you're supposed to use that before downloading from a site. Delete the LibreOffice download and use a program to install what you need. Ubuntu's own software center is easiest for you, if not the highest in functionality. Otherwise use Synaptic.

@vigneshwaranr

This comment has been minimized.

Copy link
Owner

commented Apr 16, 2017

@hackel Thanks for the quick response. Appreciate it!

I've updated the Readme changing the installation directory to /usr/local/bin.

@vigneshwaranr

This comment has been minimized.

Copy link
Owner

commented Apr 16, 2017

@rautamiekka Thanks for helping out @ousodaniel

BTW a package for Ubuntu is available in their "Universe" repository

https://launchpad.net/ubuntu/+source/bd

(Both the ubuntu and debian packaging were contributed by @phls 🙏)

I am on a Mac. I need to install an Ubuntu VM and test the package and then update the Readme with the installation instructions. Might do it before next weekend :)

@rautamiekka

This comment has been minimized.

Copy link

commented Apr 17, 2017

@vigneshwaranr Seems I failed to check packages.ubuntu.com for it when working on multiple things at once, as bd is found there. Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.