command-not-found not working because programs.sqlite is missing - nix

I'm on the unstable nix channel:
# nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
# nix-channel --update
downloading Nix expressions from ‘https://nixos.org/releases/nixos/unstable/nixos-16.09pre78848.9549257//nixexprs.tar.xz’...
downloading ‘https://nixos.org/releases/nixos/unstable/nixos-16.09pre78848.9549257//nixexprs.tar.xz’... [ [6192/6921 KiB, 6143.1 KiB/s]
unpacking channels...
For some reason, command-not-found doesn't work:
$ command-not-found
/home/fabian command-not-found
DBI connect('dbname=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite','',...) failed: unable to open database file at /run/current-system/sw/bin/command-not-found line 13.
cannot open database `/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' at /run/current-system/sw/bin/command-not-found line 13.
Indeed, /nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite doesn't exist. What could be the reason for this?

FWIW, it seems nixos-install doesn't properly generate programs.sqlite.
I was seeing the same error on a fresh 17.03 install, even though it's working on other systems I have that are also on 17.03.
Manually running nix-channel --update was all that was needed to fix it for me. (I didn't run nixos-rebuild or anything that would have changed the versions of command-not-found.)

Apparently it's removed in the most recent channels/nixos builds and awaiting a replacement - refs (1) (2)

Related

Nixos 22.05 system build fails when referencing channel "file 'nixos-2111' was not found in the Nix search path (add it using $NIX_PATH or -I)"

When running sudo nixos-rebuild --upgrade boot I run into an error of:
error: file 'nixos-2111' was not found in the Nix search path (add it using $NIX_PATH or -I)
at /etc/nixos/chris.nix:30:23:
29| };
30| nixos-2111 = import <nixos-2111> {
| ^
31| config = config.nixpkgs.config;
This only occurred after I updated the nixos channel with sudo nix-channel --add https://nixos.org/channels/nixos-22.05 nixos (for the purpose of upgrading my Nixos system). This config built correctly previously (which is on 20.09).
What might be the cause of this issue? How can I diagnose this further? That channel definitely exists according to:
sudo nix-channel --list
nixos https://nixos.org/channels/nixos-22.05
nixos-2003 https://nixos.org/channels/nixos-20.03
nixos-2111 https://nixos.org/channels/nixos-21.11
nixos2003 https://nixos.org/channels/nixos-20.03
nixos2009 https://nixos.org/channels/nixos-20.09
unstable https://nixos.org/channels/nixpkgs-unstable
And:
nix repl '<nixos-2111>'
Welcome to Nix version 2.3.11. Type :? for help.
Loading '<nixos-2111>'...
Added 15491 variables.
My only suspicion is the new nix version of 2.8 from the prior 2.3.11 - perhaps it uses an different set of channels?
Update: Just removed the references to this channel (and the associated packages), and it built successfully. Which is weird as there were other channels referenced in this exact format so maybe something specifically to do with 21.11...

How to install syndesis (stable) on minishift

I'm trying to install syndesis on minishift following the official guides.
Installed minishift on ubuntu, no issues. Next I've tried
./syndesis minishift --install. In the end it says I have to run local dev builds for sysdesis-server syndesis-ui, etc
./syndesis build --app-images but got some dependency errors
Run syndesis quickstart. All the pods are up except syndesis-server. It doesn't start due to error like UnknownHostException: syndesis-db in the migration bean
Also tried ./syndesis minishift --install --tag 1.8.12 to install stable version but not sure if I'm doing it right cause no success
Any help ?
Sorry for the late response. We moved to use an Operator to do the installation and it caused a bunch of installation issues. If you have minishift installed then on Linux or Mac you should be able to get Syndesis installed using
bash <(curl -sL https://syndes.is/start)
See also: https://github.com/syndesisio/syndesis-quickstarts/blob/master/README.md#3-install-syndesis
It uses the syndesis bash command line tool from (https://github.com/syndesisio/syndesis/blob/master/tools/bin/), so you can check out the code yourself too and run that using:
./.syndesis/bin/syndesis minishift --install --full-reset --nodev --open
and then you can explore other options to specify a tag if you want.
Hope this gets you going!
Cheers,
--Kurt

Anyone else get this error "Error: invalid option: --with-passenger"

Can not get NGINX to install with passenger
Following the steps you are supposed to...
brew install passenger
Then you run the following command...
brew install nginx --with-passenger
But I get:
Error: invalid option: --with-passenger
Could not find any resources about this online, so asking here.
$ brew install nginx --with-passenger
Usage: brew install [options] formula
Install formula.
formula is usually the name of the formula to install, but it can be specified
in several different ways.
-d, --debug If brewing fails, open an interactive
debugging session with access to IRB or a
shell inside the temporary build directory
--env If std is passed, use the standard build
environment instead of superenv.If super
is passed, use superenv even if the formula
specifies the standard build environment.
--ignore-dependencies Skip installing any dependencies of any
kind. If they are not already present, the
formula will probably fail to install.
--only-dependencies Install the dependencies with specified
options but do not install the specified
formula.
--cc Attempt to compile using provided
compiler. compiler should be the name
of the compiler's executable, for instance
gcc-7 for GCC 7. In order to use LLVM's
clang, use llvm_clang. To specify the
Apple-provided clang, use clang. This
parameter will only accept compilers that
are provided by Homebrew or bundled with
macOS. Please do not file issues if you
encounter errors while using this flag.
-s, --build-from-source Compile the specified formula from source
even if a bottle is provided. Dependencies
will still be installed from bottles if
they are available.
--force-bottle Install from a bottle if it exists for the
current or newest version of macOS, even if
it would not normally be used for
installation.
--include-test Install testing dependencies required to
run brew test.
--devel If formula defines it, install the
development version.
--HEAD If formula defines it, install the HEAD
version, aka. master, trunk, unstable.
--fetch-HEAD Fetch the upstream repository to detect if
the HEAD installation of the formula is
outdated. Otherwise, the repository's HEAD
will be checked for updates when a new
stable or development version has been
released.
--keep-tmp Don't delete the temporary files created
during installation.
--build-bottle Prepare the formula for eventual bottling
during installation.
-f, --force Install without checking for previously
installed keg-only or non-migrated
versions.
-v, --verbose Print the verification and postinstall
steps.
--display-times Print install times for each formula at the
end of the run.
-i, --interactive Download and patch formula, then open a
shell. This allows the user to run
./configure --help and otherwise
determine how to turn the software package
into a Homebrew package.
-g, --git Create a Git repository, useful for
creating patches to the software.
-h, --help Show this message.
Error: invalid option: --with-passenger
This is supposed to work... so yeah.
A late answer. Obviously the documentation on the passenger site is outdated at time of this writing.
According to phusion's github site
https://github.com/phusion/passenger/issues/2187#issue-416881033
the config option --nginx-with-passenger is not valid anymore.
Instead do:
brew install nginx passenger
Addendum:
When using google search for results currently the old page comes up at the top of the list. Here's the currently maintained page with the accurate information:
https://www.phusionpassenger.com/docs/advanced_guides/install_and_upgrade/nginx/install/oss/osx.html

How to undo `nix-channel --update`

After clean installation via NixOps, I logined to machine and executed
# nix-channel --update
This pulled ~130Mb of nixpkgs into my /nix/store. How can I undo this?
On a normal Nix or NixOS install, if you've updated your channels by accident with nix-channel --update, you can undo this by running
nix-channel --rollback
See the manual for more details.
On a NixOps installation, channels are configured but not actually used. See the other answer for that.
On a NixOps installation it seems that channels are configured, but aren't actually used by NixOps. This means that running nix-channel --update will create the very first generation, and nix-channel --rollback won't work as that can't roll back past the first generation.
The following seems to work for clearing out this information.
Do not run this on a Nix or NixOS install! This is just for NixOps.
rm /nix/var/nix/profiles/per-user/root/channels-1-link
rm /nix/var/nix/profiles/per-user/root/channels
rm ~/.nix-defexpr/channels
nix-collect-garbage -d

OpenSuse - Can't install Rails: File not found on medium

I'm trying to set up a Ruby on Rails environment within OpenSuse, but I've encountered a problem. When running sudo zypper install rubygem-railties-3_2 all I get is File '/repodata/repomd.xml' not found on medium 'http://download.opensuse.org/repositories/Banshee/12.1/'. So something seems to be wrong at their side.
Is there anyone who as a workaround for, or more info about, this problem?
When running the command $ sudo zypper up I was receiving a similar error:
File ... not found on medium http:// ...
Detailed error:
File './x86_64/libxkbcommon0-0.7.2-48.2.x86_64.rpm' not found on medium 'http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_Leap_42.3/'
The solution which worked for me was to run $ sudo zypper ref before running $ sudo zypper up
Obviously, you have setup an additional repository for Banshee for a very old opensuse version. Opensuse only keeps its repositories alive for the last two two releases to the current release. For this reason, you get this error. You can disable or remove the repositorium to resolve the error.
In order to install packages that are not part of the currently configured repositories, it is the easiest to use the one-click install available at https://software.opensuse.org/search .

Resources