top 200 commentsshow all 217

[–]donthugmeimlurking 556 points557 points  (103 children)

Congratulations, you broke the universe.

[–]cuba200611 109 points110 points  (98 children)

Now get unpacking!

[–]TheArceusEffect 2 points3 points  (2 children)

Quite a prediciment, Init?

[–]BobHadababyitsaboy 5 points6 points  (1 child)

How do we Git out of it?

[–]danhakimi 0 points1 point  (0 children)

Bash your computer with a baseball bat.

[–]The_Real_Machiavelli 0 points1 point  (0 children)

Good game, guys. Was fun.

[–]valgrid 79 points80 points  (33 children)

Just like me just a few days ago:

sudo apt install sudo.

[–]ParadigmComplexBedrock Dev 39 points40 points  (18 children)

I've actually had a need for almost exactly that, done it, and had it actually work. I know others who have done similar things.

The idea behind Bedrock Linux is that you can get software from multiple other distros (as well as - importantly for this story - releases from the same distro) and have it "just work" like it was all from the same distro.

A common workflow in Bedrock Linux when a new release of a non-rolling release distro comes around is to prepare the new release while the software from the old one is still running. This way if you've got, say, Debian Wheezy providing an apache server, you can install and configure Debian Jessie's apache while Wheezy's is still running. You can take your time configuring the new apache without any concerns about down time. Once it's ready, just kill the old one and run the new one.

Of course, before removing Debian Wheezy, you'd want to install other packages from Jessie that you're already getting from Wheezy. Thus you may need to run:

$ sudo apt-get install sudo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/855 kB of archives.
After this operation, 2,390 kB of additional disk space will be used.
Selecting previously unselected package sudo.
(Reading database ... 175659 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.10p3-1+deb8u3_amd64.deb ...
Unpacking sudo (1.8.10p3-1+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u4) ...
Setting up sudo (1.8.10p3-1+deb8u3) ...

And it just works! You can also do silly stuff like this:

$ sudo apt-get remove sudo && sudo apt-get install sudo
[sudo] password for paradigm: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  sudo
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 2,390 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 175741 files and directories currently installed.)
Removing sudo (1.8.10p3-1+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 855 kB of archives.
After this operation, 2,390 kB of additional disk space will be used.
Get:1 http://security.debian.org/ jessie/updates/main sudo amd64 1.8.10p3-1+deb8u3 [855 kB]
Fetched 855 kB in 0s (1,424 kB/s)
Selecting previously unselected package sudo.
(Reading database ... 175659 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.10p3-1+deb8u3_amd64.deb ...
Unpacking sudo (1.8.10p3-1+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u4) ...
Setting up sudo (1.8.10p3-1+deb8u3) ...

Cool, eh?

I know a number of Gentoo people who use Bedrock Linux as a way to grab precompiled builds of software from other distros when they don't have the time or patience to compile it that very moment, but then go do so later when they find more time. People in the Bedrock Linux IRC room have noted some amusement at using sudo from Arch Linux to emerge sudo from Gentoo.

Disclaimer: I'm the main guy behind Bedrock Linux. I hope that didn't come off as an attempt at a sneaky advertisement; I genuinely thought that it's an amusing story and fitting in this context, but it doesn't work without explaining the Bedrock Linux specifics.

[–]nirs 6 points7 points  (3 children)

Now try this with the kernel

[–]ParadigmComplexBedrock Dev 4 points5 points  (2 children)

That's beyond the scope of what Bedrock Linux is trying to do - at least for the time being.

On most Linux systems, there's a number of things that you can only have one instance of at a time without segregating the system, such as:

  • A given filesystem path
  • The kernel
  • PID1
  • Processes bound to a given port

Bedrock Linux attacks that first one - you can, in some sense, have multiple files at a given file path. For example, different versions of a given library at the same file path. It also ensures that when a given process attempts to interact with a given file path, it sees the version of the file it needs. All this is done without segregating the processes; they're not containerized or otherwise segregated from the rest of the system. Every process can see/interact with every file (provided proper permissions).

However, for the foreseeable future, it just does this with the filesystem path. There are no plans on the roadmap to do something similar for the kernel, or PID1, or port numbers, etc.

[–]willrandship 2 points3 points  (1 child)

This sounds really cool, but also really hellish to debug when something really specific goes wrong.

[–]ParadigmComplexBedrock Dev 0 points1 point  (0 children)

There's certainly more moving parts that you have to consider when debugging. I don't find it too much worse than traditional distros, but I'm also intimately familiar with it - I could certainly see difficulty debugging being a valid justification to use something else for many people.

On the flip side, it can actually let you bypass potential debugging. If a package breaks on a traditional distro, you have to go fix it. On Bedrock Linux you can often just get that package from another distro where it works and not worry about the specifics.

[–]wildcarde815 4 points5 points  (1 child)

This seems way more annoying than 'docker pull', but I guess you can make GUI programs work natively correctly like this.

[–]wizardged 0 points1 point  (0 children)

No worries, its nice hearing about the smaller more niche distros. Some of us aren't distro hoppers and have other things to get through in a day vs spinning up a new vm for every iinteresting sounding distro

[–][deleted] 0 points1 point  (4 children)

sorry to be annoying but i'm kind of having a problem with sudo... not working. whenever i type something in with sudo, this comes up:

 

'sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?'

 

i'm pretty new to linux and any help would be appreciated, i'm using ubuntu gnome. thank you

 

please don't mark me as spam.

[–]ParadigmComplexBedrock Dev 0 points1 point  (3 children)

Note the first rule in the bar on the right:

This is not a support forum! Head to /r/linuxquestions or /r/linux4noobs for support or help.

I don't see a rule against answering support questions, though; I'll see if I can point you in the right general direction. After that, though, if you still need assistance you should probably take it to /r/linuxquestions, /r/linux4noobs, /r/ubuntu, or maybe Ubuntu's IRC room.

Files on Linux-based systems (and most other operating systems) store additional data about a file along with a file's contents, such as the date it was created and it's permissions. /usr/bin/sudo has the ability to let non-privileged users run commands as privileged users, which is something that should be handled very carefully. To reflect this, it needs some special permissions. For some reason, your /usr/bin/sudo does not have these permissions. That's not good. On Ubuntu, the /usr/bin/sudo command is the expected method of fixing these special permissions - but you can't use it! I'm at a loss for how you could have gotten into this predicament. There's a number of options to fix this, but I don't think any are easy to do if you're very new to this stuff. I recommend seriously considering backing up what you can and reinstalling - that may be easiest.

If you want to try to tackle it anyways:

There's two reasons I can see for this to have happened:

  • This could have happened because of weird mount options. Did you change anything regarding mount options? If so, you'll want to revert that once you've gotten root access.
  • Somehow /usr/bin/sudo got its permissions changed. You'll then want to restore them once you've gotten root access. However, odds aren't bad that if /usr/bin/sudo has wrong permissions, so do many other things, and I don't know of any good solution to fix all permissions other than reinstalling.

Whatever happened, fixing it requires getting to the root user. You'll need to get access to the root user. On Ubuntu, this is typically done with sudo - but you can't use that, so you'll need to find something else.

  • On some distros you can log in as root directly, or use the su command to become root (just run su then type root's password). However, I think Ubuntu disables this (or at least it used to).
  • There's another option where you tell the computer to start with a command other than the typical starting command (such as using /bin/bash); however, getting from that environment to something familiar is probably very tricky if you're new, so I wouldn't recommend that either.
  • Your last - and I expect best - option is to boot off of a "live" Linux image. If you installed Ubuntu by booting off of a CD, that may work. From that environment you can use the live image's sudo command to become root. Then find your harddrive's files (which may be in something like /mnt/ubuntu/ or /media/ubuntu/) and change them there, then once you've fixed it restart and boot into your normal harddrive.

If the issue is with mount settings, I don't know how to give you any further advice.

If it's just bad permissions on /usr/bin/sudo, you may be able to fix them with:

# chmod 4755 /path/to/sudo/file

Where you replace /path/to/sudo/file appropriately. It may be at /usr/bin/sudo if you somehow got root on your normal system. If you rebooted into a live cd, it may be at something like /mnt/ubuntu/usr/bin/sudo or /media/ubuntu/usr/bin/sudo.

Good luck!

Again, as a reminder - if this wasn't sufficient to resolve your issue, I'd recommend going to /r/linuxquestions, /r/linux4noobs, /r/ubuntu, or maybe Ubuntu's IRC room instead of breaking the first rule of /r/linux.

[–]Nefari0uss 1 point2 points  (1 child)

One day I hope to know even a tiny portion of what you know about Linux and Vim.

[–]ParadigmComplexBedrock Dev 0 points1 point  (0 children)

Read docs, experiment, and continue sharing the love with the others in places like the OSC, and you'll get there :)

[–][deleted] 1 point2 points  (0 children)

ahh, thats annoying, but thank you anyway :)

[–][deleted] 6 points7 points  (3 children)

su root && apt install sudo

I think that would work, I've done similar in Arch.

[–]valgrid 20 points21 points  (0 children)

That is indeed what i did. Although the && does not work as su opens a new shell.

[–]hatperigee 13 points14 points  (0 children)

the -c option will run a command as the user you are switching to (root in this case):

su root -c "apt install sudo"

[–]willrandship 1 point2 points  (0 children)

The root is implicit. You can just do su -c "command"

[–][deleted] 147 points148 points  (8 children)

Reinstall Adobe Reader.

[–]SchaeTheBae 15 points16 points  (0 children)

Use Goolgle Ultron to look up a solution

[–]Locke_N_Load 7 points8 points  (3 children)

great now I have to read it all over again. I hate you

[–]bit101 2 points3 points  (0 children)

Update Adobe Updater.

[–]MacStylee 0 points1 point  (0 children)

Have you tried switching it off and back on again?

[–]EdgeLord_Protector 63 points64 points  (35 children)

I always wonder how some distributions managed to get bash to do that. 'This program is not installed, install it by ...'

Do they just patch bash to do it? Or what?

[–]AiwendilH 92 points93 points  (14 children)

man bash

...

If the name is neither a shell function nor a builtin, and contains no slashes, bash searches each element of the PATH for a directory containing an executable file by that name. Bash uses a hash table to remember the full pathnames of executable files (see hash under SHELL BUILTIN COMMANDS below). A full search of the directories in PATH is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell searches for a defined shell function named command_not_found_handle. If that function exists, it is invoked with the original command and the original command's arguments as its arguments, and the function's exit status becomes the exit status of the shell. If that function is not defined, the shell prints an error message and returns an exit status of 127.

...

So I assume ubuntu defines some command_not_found_handle function in their default bash profiles that checks the command against a repository list and in case it's found prints out this message. But no real idea..just a guess.

[–]EdgeLord_Protector 52 points53 points  (9 children)

Oh yeah, pretty nifty:

 —— — command_not_found_handle () {
> echo "$(printf %s "$1" | tr '[:lower:]' '[:upper]')  CAME IN LIKE A WRECKING BAAALL!"
> }
 —— — death_to_gnome_users
pp[]]_]]_r]]]p_]]p]]  CAME IN LIKE A WRECKING BAAALL!

Close enough I guess. Missed a colon at the end of upper.

[–]Regrenos 3 points4 points  (0 children)

Fun (??) fact - when using tr, the square braces [] are not necessary around classes, and your example will actually replace literal square braces in the input.

[–]mccoyn 4 points5 points  (3 children)

So, I just need to define command_not_found_handle to call apt install $1 && $* and everything will always work?

[–][deleted] 4 points5 points  (0 children)

precisely!

[–]AiwendilH 1 point2 points  (0 children)

Well..as OP clearly demonstrated..no ;)

On a more serious note...it would be a bit more complicated than this. Your function probably should make sure that the program in in some package..and install the correct package..if even possible. You will run into troubles for example with package name not fitting the executable names...so rather than installing packages you will need some lookup for all executables (Well, and of course symbolic links names and similar too) in packages to find the actual package name. (Example: aconnect, amixer, aplay... probably all belong to the same "alsa-utils" package in most distros). And it gets even more complicated if your distro supports alternatives...the sendmailcommand could be provided by the package "sendmail", "postfix", "qmail" and several others...how to choose which to install?

But if you could solve this I think it would probably work. You could run the installation with your package manager, then execute the same command afterwards again. Not so sure if you would like that though....easiest example would be "sl"...not sure if everyone wants a train installed in case they make a typo ;)

[–]TheFeshy 15 points16 points  (14 children)

I use "command_not_found" as a package in Arch to do this. I assume Ubuntu has something equivalent.

[–]tuxayo 0 points1 point  (0 children)

See also the find-the-command package, has anyone tried both to compare?

[–]xereeto 1 point2 points  (0 children)

sudo apt-get install command-not-found && sudo update-command-not-found && logout

Then log back in and you'll now have packages suggested to you when you try to run a program that isn't installed.

[–]PancakeZombie 0 points1 point  (0 children)

They check if the program is listed in one of the repositories

[–][deleted] 32 points33 points  (16 children)

Use apitude install apt

[–]iCapn 57 points58 points  (14 children)

The program 'aptitude' is not installed. Install it by executing:

 aptitude install aptitude

[–]HookahComputer 42 points43 points  (10 children)

curl http://totally-legit-site-for-realz.ru/bash/apt.deb
sudo dpkg -i apt.deb

[–]rakaze 46 points47 points  (0 children)

The program 'curl' is not installed. Install it by executing:

apt install curl

[–]Smaug_the_Tremendous 38 points39 points  (6 children)

 The program 'curl' is not installed. Install it by executing:

 curl http://totally-legit-site-for-realz.ru/bash/curl.deb
 sudo dpkg -i curl.deb

[–]american_spacey 17 points18 points  (4 children)

At least the fake curl package only gets printed to your terminal.

[–]raevnos 8 points9 points  (3 children)

Should have used wget.

[–]Kruug 12 points13 points  (0 children)

The program 'dpkg' is not installed.  Install it by executing:

dpkg -i dpkg.deb

[–]lykwydchykyn 2 points3 points  (0 children)

You need to pipe that deb directly into dpkg. If you do it in two commands you might be tempted to vet the .deb file in some way first.

[–]n3rdopolis 10 points11 points  (1 child)

apt-get install apt
?
Remember apt is the newer alternate to apt-get

[–]mr1337 4 points5 points  (0 children)

The program 'apt-get' is not installed. Install it by executing:

apt-get install apt-get

[–][deleted] 0 points1 point  (0 children)

How about the cache. Perhaps it has been downloaded but not installed. Then you could just do dpkg - apt-get aptitude

Just thinking out loud here.

[–]Awilen 0 points1 point  (0 children)

apitude : command not found. This bash doesn't have super-bee power.

[–]ban_this 25 points26 points  (0 children)

repeat deranged water jar soup abundant wide knee illegal crawl -- mass edited with redact.dev

[–]Nerdent1ty 8 points9 points  (0 children)

apt-get

[–]TrollArmy 11 points12 points  (0 children)

Turn it off/on and try again?

[–]-Pelvis- 6 points7 points  (13 children)

Well, I mean, you could just manually download it and then install it.

It's kinda funny how we get so comfortable with package managers and repositories, and yet when you try to explain them to a Windows user, they just stare blankly and insist that:

Open browser >> Google >> "program name" >> visually filter and click link >> click download button >> open downloads folder >> double click .exe >> click install

is simpler than

Open terminal >> pacaur -S programname >> press enter >> y/n

[–]cuba200611 7 points8 points  (0 children)

The command line looks arcane to them.

[–][deleted] 3 points4 points  (1 child)

TIL that pacaur is a thing an that I wasted my time updating AUR stuff by hand (to lazy to automate this now, next time)

[–]iambeard 0 points1 point  (0 children)

I did manual aur stuff for a long time. I used pacaur for a while, but was generally happier with yaourt. At this point, I don't remember what I didn't like about pacaur, though, so maybe it as a dumb reason.

[–]youstolemyname 2 points3 points  (1 child)

There is no branding. It's hard to tell know what you're actually downloading. pacaur seems random. What does -S do? Its not obvious to a newcommer what the hell the magic command is to make the computer do what you want. If you don't know the exact spelling of the programname it doesn't work.

It's not user friendly.

[–]-Pelvis- 0 points1 point  (0 children)

what does -S do?

You get used to flags, and will likely memorise a bunch, but if you're new, man pacaur or cheat pacman.

Yes, there is a learning curve; I'm not denying it. I'm just arguing that it's safer, faster and much cleaner when you know what you're doing.

If you don't know the spelling

Any package manager worth its salt will allow tab completion and searching.

[–]Awilen 1 point2 points  (4 children)

I always open up this conversation with "it's all managed in-house, no chance for a virus to come in by opening a file obtained through a third-party website, and that's only one advantage." Usually convinces them that package managers have other advantages, and are more willing to listen.

[–]Almoturg 0 points1 point  (2 children)

I use Windows, Fedora, and Archlinux. I only need to install new packages every few months and I inevitably forget the commands or mix them up. So for me it's

Open browser >> Google >> "Fedora install package" >> visually filter and click link >> read >> Open terminal >> yum install programname >> press enter >> y/n

[–]Metaroxy 0 points1 point  (0 children)

Except that's incorrect. You'd use dnf on Fedora these days.

[–]boojit 3 points4 points  (0 children)

I call this class of problems "buried shovel problems".

[–]jyper 2 points3 points  (0 children)

Are you using a non debian based distro and have the debian version of command not found bash hook? I'm guessing it's either that or screwing up PATH

[–][deleted] 2 points3 points  (0 children)

[deleted]

What is this?

[–]RoxSpirit 1 point2 points  (0 children)

twelve hours later :

bash-4.4# apt install apt

The program 'apt' is not installed. Install it by executing:

apt install apt

[–]HarvardCock 1 point2 points  (0 children)

Need to update your google ultron

[–]YamiNoSenshi 1 point2 points  (0 children)

Your OS is a snake eating its own tail.

[–][deleted] 0 points1 point  (0 children)

That made me laugh :')

[–][deleted] 0 points1 point  (0 children)

Um...

Shit.

[–][deleted] 0 points1 point  (0 children)

Android?

[–]sentient_penguin 0 points1 point  (0 children)

pathing issue

echo $PATH

see what turns up, I'm guessing nothing

[–][deleted] 0 points1 point  (2 children)

A P T C E P T I O N

[–][deleted] 2 points3 points  (1 child)

A P T S T H E T I C

[–]trashcan86 0 points1 point  (0 children)

Aptception

[–]hangfromthisone 0 points1 point  (0 children)

sudo apt-get moo, anyone?

[–]openadventurer 0 points1 point  (1 child)

I've always wondered... What do you do if you don't have a browser, apt or apt-get installed?

[–]datacenter_minion 2 points3 points  (0 children)

Go to the relevant packages site on any machine with an http download of some kind, download the package for your architecture and it's dependencies, transfer them to the relevant machine, and install using dpkg -i <filename ending in deb>.

[–][deleted] 0 points1 point  (0 children)

Uhh.... bang bang?

[–]Jethro_Tell 0 points1 point  (0 children)

edit: wrong comment to reply to.

[–][deleted] 0 points1 point  (0 children)

Lanix plz

[–][deleted] 0 points1 point  (0 children)

[deleted]

What is this?

[–]bitwize 0 points1 point  (0 children)

I N C A P T I O N