How can I install xclip on an EC2 instance?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 11:21:45

问题


I'm following Github's instructions for adding an SSH key. I've generated the id_rsa.pub file from my AWS EC2 instance, but I cannot complete the step that has me copy the contents of the file using xclip because I cannot install xclip onto the EC2 instance.

  1. I tried to install xclip on the EC2 instance using sudo yum install xclip, but that didn't work ("No package xclip available").
  2. So I looked around and found more detailed install instructions, but they didn't work either ("curl: (22) The requested URL returned error: 404 Not Found"), and the suggested correct URLs in the comments also failed.
  3. (I also tried just copying the text contents of the id_rsa.pub file using Putty and ctl-c, but Github declared the resulting key invalid.)

So, how do I install xclip on 64-bit Amazon Linux AMI 2012.09?


回答1:


I needed this today for a file larger than a ssh-key, and cat was not enough. You need to enable the EPEL repo in EC2 in order to get xclip:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum-config-manager --enable epel
sudo yum install xclip -y



回答2:


You don't need xclip. Just ssh into the EC2 instance and cat the key to your terminal, then copy and paste it from your terminal to wherever you need it.




回答3:


I don't mean to wake up the zombies but in case someone is still wondering you can wget the rpm (i.e. from here) and then

sudo yum localinstall xclip-0.12-1.el6.x86_64.rpm

Note: you may need to do the same for some dependencies.



来源:https://stackoverflow.com/questions/13146314/how-can-i-install-xclip-on-an-ec2-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!