How to remove yum repositories - redhat

(This seems to be a rather straightforward question but I can't find the answer on SOF. Let me know if I missed a post and I will delete this!)
Hello! How to delete the repositories that are listed in yum repolist?
For example, when I ran yum reoplist, I got (for example):
repo id repo name
pgdg93/7Server/x86_64 PostgreSQL 9.3 7Server - x86_64
But man yum does not tell me how to remove the repo if they are no longer in use (e.g. ). I tried sudo yum-config-manager --disable pgdg93/7Server/x86_64 but the result of yum repolist is the same. Btw, this repo is installed through rpm install [url]
Thanks!

It's either a file in /etc/yum.repos.d/ (new way) or an entry in /etc/yum.conf (old way). See https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Configuring_Yum_and_Yum_Repositories.html for details.

We have multiple ways to do the same.
You may be able to go into /etc/yum.repos.d/ and remove the file corresponding to the repository.
You can also try to remove the repo and add with yum-config-manager
yum-config-manager --disable repository
yum-config-manager --add-repo http://www.example.com/example.repo
You can temporarily remove/disable a yum repo by adding the --disablerepo=(repo name) to your yum line.
yum --disablerepo=some-repository install some-package

Related

How to use/install a GitHub commit?

There is a package I want to use that is implemented based on fairseq toolkit. The package requirement says:
Please use an earlier commit of Apex - NVIDIA/apex#4a8c4ac
Even though I know how to install Apex, I'm not sure if I understand what it means to use an earlier commit of a package and how exactly I can use the commit (e.g., how can I install a commit of a package)? Does it just mean a specific version of that package? And if so, how can I find that specific version from a commit?
Well, I figured out how to install a specific commit! Here is how in case anyone else is wondering:
$ git clone https://github.com/nvidia/apex
$ cd apex
$ git checkout <commit hash>
$ pip install ... # whatever install command
So for example, if there is a specific commit for a GitHub repo like the following (in my case, I was trying to use an earlier commit of Apex):
https://github.com/NVIDIA/apex/commit/4a8c4ac088b6f84a10569ee89db3a938b48922b4
After cloning the repo, you run:
git checkout 4a8c4ac088b6f84a10569ee89db3a938b48922b4
Using this command, you in fact change the HEAD to a specific commit. Then, you install your package using whatever command you have.

openshift rhc you do not have git installed

I am trying to setup the rhc client for openshift. I followed the tutorial precisely. After installing ruby, git and the rhc gem, the setup went perfect. But it wont clone my app to my computer. When I type rhc git-clone it says that git is not installed, but git --version works fine.
Ok, git installs itself default in users\\appdata\local\Git . I read somewhere that you shouldn't mess with the folder. But older versions installed in program files. So i tried that and rhc found it immediatly.
So just install git in C:\Program Files\Git
Just an additional piece of information to RiverWalker's self answer: run the git install as 'administrator'. Then "C:\Program Files\Git" directory will be used as the default installation dir.

Push yeoman project to github

I try to work on a yeoman project with a team. After generating the angularjs code with > yo angular and pushed the folder to github
git add .
git push
git commit origin master
and when I clone the code from git github I have this error
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or
grunt hasn't been installed locally to your project. For more
information about installing and configuring grunt, please see the
Getting Started guide:
http://gruntjs.com/getting-started
so I deleted every thing from .gitignore and pushed everything again, I had this warning
The file will have its original line endings in your working
directory.
So I am quite sure it's not going to work and it's not the best way to do it. Can someone help me on how to upload the yeoman project ?
I think that angular generator for Yeoman already creates a package.json file with grunt defined as dependency along with all its task. So the correct way to compile a project after the clone is to install all npm dependencies locally using:
npm install
then run grunt to compile everything:
grunt
Of course you must have grunt-cli globally installed, which is used to run grunt locally. To install it you have to use the following command where -g defined the global install (default is local):
npm install -g grunt-cli
First of all, i think you have a typo in your question, you have mixed commit and push commands:
git add .
git commit -m 'commit message' // message is optional
git push origin master
First message appears because you don't have an installed Grunt. Install it in your working directory:
npm install grunt --save-dev
Starting with Grunt v0.4, you should never install Grunt itself
globally. For more information about why, please read this. Source: grunt-cli docs.
If it is alredy listed in the devDependencies, just run:
npm install
The second one is caused by line-endings. It is a good practice to include .gitattributes file in your repo. File's content should be:
* text=auto
Read about this file: docs. Or there is another method. It is described in this question.

Root privileges to install ruby gems on Openshift

How can I get root privileges in my Openshift app? I need to install additional gems to my Openshift virtual machine and it's impossible to do it without superuser privileges.
For login, I'm using SSH:
ssh generated-hash#myapp-myns.rhcloud.com
I've already entered my id_key.pub to the Openshift web interface and I'm doing SSH with no password.
To install additional gems in openshift see this forum, copied from ramr answer:
So what you would need to do is add a Gemfile + Gemfile.lock to your
app and then do a git push -- see
https://github.com/openshift/rails-example for an example
Gemfile+Gemfile.lock.
Steps to do that: 1. Create an appropriate Gemfile -- probably
something like:
source 'http://rubygems.org'
gem 'whois'
gem "minitest"
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exists?(local_gemfile)
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
instance_eval File.read(local_gemfile)
end
On your workstation do a bundler install bundle install (you might
need to gem install bundler before you can use bundler). That should
create a Gemfile.lock - add that and the Gemfile and commit git add
Gemfile Gemfile.lock, git commit Gemfile Gemfile.lock -m 'added deps'
Push changes to your OpenShift App git push HTH

git push error "fatal: Unable to find remote helper for 'https'"

I've added remote origin like:
git remote add origin https://github.com/username/repo.git
When I push the git repository, I get this error:
git push -u origin master
fatal: Unable to find remote helper for 'https'
I am on git 1.7.1 on Ubuntu 10.04.4 LTS
Any ideas, greatly appreciated
If you compiled git from source, be sure to install this package first:
apt-get install libcurl4-openssl-dev
I just got the problem yesterday and solved it today, so am posting in case this might help a Windows user. For me, the problem occurred after I updated to the latest version of Git (because Visual Studio was recommending I do so-- something about things not matching.)
It turns out that I installed in the default directory Program Files, but my old Git was in Program Files (x86). (Hadn't noticed until tried reinstalling.)
Uninstalling the new version and installing the 64-bit Git for Windows Setup listed under Other Git for Windows downloads (which is not the default) overlaying the version in Program Files (x86) worked. (I tried other combinations of version and folders first.)
I did have to delete the local repository already created and restart with git init, git add ., git commit -m "first commit", git remote add origin theGitUrl (all of which worked before), before doing the git push origin master. The weird thing is that a pop-up window appeared to enter my user name and password. I didn't notice it at first and thought the processing on the git push was hung up. So, heads up about that "Other Git for Windows" version.
I did change my Environmental Variables before the fix; I don't know if that helped. I added these 2 to the PATH:
C:\Program Files (x86)\Git\bin
C:\Program Files (x86)\Git\libexec\git-core
I did this for both User and System variables.
A note on updating the PATH in Windows 10: you have to add one at a time and not include the ;
After much searching, the answer is you need git version 1.7.7
Can't update RVM - "fatal: Unable to find remote helper for 'http'"
I was working in a chroot jail and thought i had copied everything i needed for git to work but i was missing the git-core files themselves so i just had to copy them:
cp -r /usr/lib/git-core /opt/chroot/myjail/usr/lib/
Add this to git config: (Checked in centos 6.7 and working)
#git config --global url.https://.insteadOf git://
#To see the config added
#git config --list
url.https://.insteadof=git://
user.name=username
user.email=youremail
....