Running nix-env -i emacs-redo+ gives me an error.
inaimathi#self:~$ nix-env -i emacs-redo+
error: selector ‘emacs-redo+’ matches no derivations
inaimathi#self:~$
But the package both seems to exist, and is visible.
inaimathi#self:~$ nix-env -qa | grep emacs-redo
emacs-redo+-20131117.551
inaimathi#self:~$
Giving the exact package name, and escaping the + gives me the same error.
inaimathi#self:~$ nix-env -i emacs-redo+-20131117.551
error: selector ‘emacs-redo+-20131117.551’ matches no derivations
inaimathi#self:~$ nix-env -i emacs-redo\+
error: selector ‘emacs-redo+’ matches no derivations
inaimathi#self:~$ nix-env -i emacs-redo\+-20131117.551
error: selector ‘emacs-redo+-20131117.551’ matches no derivations
inaimathi#self:~$
What am I doing wrong?
I'm not sure how you've made the command nix-env -qa | grep emacs-redo succeed, but my attempts to locate the package that way all show nothing:
$ git checkout -q master && git log -1 --oneline
310aadc Merge pull request #12557 from ryanartecona/nixos-manual-custom-options
$ nix-env -qa | grep -i redo
exit code: 1
$ git checkout -q release-15.09 && git log -1 --oneline
5a4e183 linux: patch CVE-2016-0728 (close #12492)
$ nix-env -qa | grep -i redo
exit code: 1
$ git checkout -q release-14.12 && git log -1 --oneline
9d6ba7d keepassx: 0.4.3 -> 0.4.4
$ nix-env -qa | grep -i redo
haskell-heredoc-ghc7.8.3-0.2.0.0-profiling-shared
haskell-heredoc-ghc7.8.3-0.2.0.0-shared
haskell-heredoc-ghc7.8.3-0.2.0.0-shared
As far as I can tell, there is no emacs-redo, hence it's not surprising that nix-env -i won't work for that package.
However, if you're following the master branch of the Nixpkgs git repository (a.k.a. the unstable channel), then you'll find that package in the emacsPackagesNg package set as follows:
$ nix-env -qaP -A emacsPackagesNg | grep -i redo
emacsPackagesNg.redo-plus emacs-redo-plus-20131117.551
If you want to use that, then you may have to convert your Emacs installation to that new package set entirely -- I don't believe that you easily mix packages from the old and the new Emacs package set.
Anyhow, emacsPackagesNg is work-in-progress and it may not be completely reliable yet, although https://github.com/NixOS/nixpkgs/issues/11503 suggests that people do use it successfully already.
Related
I use this script to install swiftlint on travis:
set -e
SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.25.1/SwiftLint.pkg"
wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL
if [ -f $SWIFTLINT_PKG_PATH ]; then
echo "SwiftLint package exists! Installing it..."
sudo installer -pkg $SWIFTLINT_PKG_PATH -target /
else
echo "SwiftLint package doesn't exist. Compiling from source..." &&
git clone https://github.com/realm/SwiftLint.git /tmp/SwiftLint &&
cd /tmp/SwiftLint &&
git submodule update --init --recursive &&
sudo make install
fi
It's not the best way to always update it if needed in this script - is it possible to point to always the latest released pkg?
You can get info about last release from API: https://api.github.com/repos/realm/SwiftLint/releases/latest
To get tag name:
curl --silent "https://api.github.com/repos/realm/SwiftLint/releases/latest" |
grep -Po '"tag_name": "\K.*?(?=")'
To get download URL for pkg file:
curl --silent "https://api.github.com/repos/realm/SwiftLint/releases/latest" |
grep -Po '"browser_download_url": "\K.*?.pkg(?=")'
Source of one-liners.
Engineer Engelbert, a fierce OpenSuSE 11-sp4 user, is in possession of two RPM packages with the same contents:
rpm -qlp ~/onemy_ls_0.0.1_x86_64.rpm | tee a
/.osc/_apiurl
/.osc/_files
/.osc/_meta
/.osc/_osclib_version
/.osc/_package
/.osc/_project
/my_ls/my_ls.sh
rpm -qlp ~/my_ls_0.0.1_x86_64.rpm | tee b
/.osc/_apiurl
/.osc/_files
/.osc/_meta
/.osc/_osclib_version
/.osc/_package
/.osc/_project
/my_ls/my_ls.sh
diff a b | wc
0 0 0
Engineer Engelbert has realized that he can install both packages with no warning from RPM:
rpm -e my_ls-0.0.1-1 ; rpm -i ~/my_ls_0.0.1_x86_64.rpm
rpm -e onemy_ls-0.0.1-1 ; rpm -i ~/onemy_ls_0.0.1_x86_64.rpm
Engineer Engelbert is self-assured about his choices. He knows that's probably a good design choice from rpm developers. So, he checked the man page, certain that there would be an option for not allowing rpm packages to overwrite files in the system. But all the install options he found were:
install-options
[--aid] [--allfiles] [--badreloc] [--excludepath OLDPATH]
[--excludedocs] [--force] [-h,--hash]
[--ignoresize] [--ignorearch] [--ignoreos]
[--includedocs] [--justdb] [--nodeps]
[--nodigest] [--nosignature] [--nosuggest]
[--noorder] [--noscripts] [--notriggers]
[--oldpackage] [--percent] [--prefix NEWPATH]
[--relocate OLDPATH=NEWPATH]
[--repackage] [--replacefiles] [--replacepkgs]
[--test]
He hesitated and found strange that there is --replacefiles, but not --keepfiles. That suggested him that keep would be the default behavior. So, he created an script:
rpm -e onemy_ls-0.0.1-1
rpm -e my_ls-0.0.1-1
rm -rf /my_ls/
rpm -i ~/my_ls_0.0.1_x86_64.rpm
ls -lh /my_ls -d
sleep 120
rpm -i ~/onemy_ls_0.0.1_x86_64.rpm
ls -lh /my_ls -d
That showed that the files were actually overwritten:
drwxr-xr-x 2 root root 4.0K Aug 16 17:07 /my_ls
drwxr-xr-x 2 root root 4.0K Aug 16 17:09 /my_ls
After a research, Engineer Engelbert couldn't still find the answer.Now he is in the middle of a flamewar about packaging systems, and, as asked by somebody, he needs your help:
How to make rpm not to overwrite files when installing new packages?
Note - Engineer Engelbert knows that he should create better rpm packages with conflicts management, you don't need to explain him that. He is mostly worried about being sure that his packages won't conflict with other proprietary unpublished packages racing for the same paths in the system.
Note - using fpm, you can regenerate Engineer Engelbert's RPMs:
mkdir -p first_pkg/my_ls/
echo ls > first_pkg/my_ls/my_ls.sh
fpm -s dir -t rpm -n onemy_ls -v 0.0.1 -C first_pkg/ -p onemy_ls_VERSION_ARCH.rpm
fpm -s dir -t rpm -n my_ls -v 0.0.1 -C first_pkg/ -p my_ls_VERSION_ARCH.rpm
Yes: rpm will overwrite all files contained in a *.rpm that are not marked with %config and there is no option to disable that behavior.
Is there a way to ask yum which group(s) contain a given package? I know how to ask what packages are in a given group, and could write a quick script to trawl over all of the groups, but it would be nice to have a simpler mechanism than that.
If you are only looking for a 'simpler mechanism' to be used by a human and don't need it in some kind of script or so, you might get by with this one:
yum groupinfo '*' | less +/sendmail-cf
Of course, replace sendmail-cf with the package name you're interested in.
You can find a group to which the specified package belongs, by using yum-list-data plugin.
$ sudo yum -y install yum-plugin-list-data
$ yum -C list-groups ftp
Loaded plugins: fastestmirror, list-data
==================== Available Packages ====================
Console internet tools 1 (100%)
list-groups done
Or, if you are not allowed to install the plugin, please save the following script and try to run it with one argument, the name of the package you try to find:
#!/bin/sh
search_name=$1
LANG=C yum grouplist -v | grep "^ " | awk -F'(' '{print $1}' | sed -e 's/^ *//' | while read line
do
if [ "${search_name}" != "" ]; then
yum groupinfo "${line}" | grep -q "^ *${search_name}$"
if [ $? -eq 0 ]; then
echo ${line}
break
fi
fi
done
I don't know about yum, but remember that it sits on top of rpm. The rpm command you're looking for is:
rpm -q --qf %{group} yourRPM
You might want to add a \n at the end, depending on that you are up to:
[root#Niflheim ~]# rpm -q --qf %{group} setarch
System Environment/Kernel[root#Niflheim ~]# rpm -q --qf "%{group}\n" setarch
System Environment/Kernel
[root#Niflheim ~]#
I'm sorry that my question seems rather vague but this is the entire problem i'm facing. I tried installing an rpm package on cygwin after downloading it from the website but i always get the same error
-bash: rpm: command not found
and I have reinstalled it twice, but i always get the same problem, and it's not just that, i can't even use simple commands like ls. Even if i write ls I get no output. This is what my screen looks like.
User#User-PC ~
$ rpm -ivh avr-binutils-2.17tinyos-3.cygwin.i386.rpm
-bash: rpm: command not found
User#User-PC ~
$ locate rpm | grep bin
User#User-PC ~
$
User#User-PC ~
$ ls
User#User-PC ~
$
what do I do to fix this?
First, locate does not auto-update itself; you must run updatedb periodically to get the current list of files. For optimal speed and usability, add the --prunepaths and --prunefs switches.
Second, try echo $PATH to see the current path, and call ls with a fully-qualified pathname: /bin/ls -l
I suspect ls is set to an invalid alias or internal function (bad command parameters). Check the contents of ~/.bash_profile, ~/.bashrc, and ~/.profile .
I'm trying to install gitflow using the directions on the github readme a la : wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
And it's failing silently...just back to the prompt. Any ideas?
Hey, it is a problem with github certificate and wget
ERROR: certificate common name `*.github.com' doesn't match requested host name `github.com'.
To connect to github.com insecurely, use `--no-check-certificate'.
just override wget checks
wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
works just fine ;)