Giter Site home page Giter Site logo

Comments (18)

kou1okada avatar kou1okada commented on August 25, 2024 2

Because for enabling upgrade-self subcommand.

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024 1

Why you want to make a repository on /usr/local/bin?
I repeat to say that following commands do not make a script /usr/local/bin/apt-cyg but a directory.

cd /usr/local/bin &&
git clone https://github.com/kou1okada/apt-cyg.git 

The script file is /usr/local/bin/apt-cyg/apt-cyg.
And your PATH have not /usr/local/bin/apt-cyg but /usr/local/bin.

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024 1

How about my home directory, is that supported?

Of course, Yes.
You can install apt-cyg anywhere you want.

I tried doing this, with a symlink to /usr/local/bin as the documentation suggests, but for some reason everytime I run apt-cyg it creates a separate apt-cyg and installation folder on my desktop instead of inside my home directory.

Perhaps, you downloaded `setup-x86_64.exe' to the DESKTOP and then executed it on the DESKTOP and installed cygwin.
Please check the location of the cache directory with following command:

apt-cyg pathof cache

Probably it will be "/cygdrive/c/Users/${USER}/Desktop" on your environment.

apt-cyg set-cache <directory> sub-command helps you to change it another location.

I'm using the default Downloads folder of Windows.
You can use it with following:

apt-cyg set-cache "$USERPROFILE/Downloads/cygwin"

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024

If you do following:

cd /usr/local/bin &&
git clone https://github.com/kou1okada/apt-cyg.git 

It clones https://github.com/kou1okada/apt-cyg.git to /usr/local/bin/apt-cyg/.
So you can't create symbolic link /usr/local/bin/apt-cyg, it is already directory.

And following is wrong too:

ln -s "$(realpath apt-cyg)" /usr/local/bin/

In this case, your working directory is /usr/local/bin.
Thus, the result of $(realpath apt-cyg) is /usr/local/bin/apt-cyg.
So ln try to make symbolic link for /usr/local/bin/apt-cyg -> /usr/local/bin/apt-cyg.
It seems like Ouroboros.
Ouroboros

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024

Directories, which I recommend for the base of git clone, are /usr/local, /usr/local/src, /usr/local/src/github.com/kou1okada, /opt, /opt/github.com/kou1okada, etc,,,.

Maybe /usr/local/src/github.com/kou1okada is the best in this case.

Try this one:

DIR=/usr/local/src/github.com/kou1okada
mkdir -p "$DIR"
cd "$DIR"
git clone https://github.com/kou1okada/apt-cyg.git
ln -s "$(realpath apt-cyg/apt-cyg)" /usr/local/bin/

Note that if you already have /usr/local/bin/apt-cyg, don't forget to remove it before running above commands.

rm -rvfi /usr/local/bin/apt-cyg

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

If you do following:

cd /usr/local/bin &&
git clone https://github.com/kou1okada/apt-cyg.git

It clones https://github.com/kou1okada/apt-cyg.git to /usr/local/bin/apt-cyg/.
So you can't create symbolic link /usr/local/bin/apt-cyg, it is already directory.

And following is wrong too:

ln -s "$(realpath apt-cyg)" /usr/local/bin/

In this case, your working directory is /usr/local/bin.
Thus, the result of $(realpath apt-cyg) is /usr/local/bin/apt-cyg.
So ln try to make symbolic link for /usr/local/bin/apt-cyg -> /usr/local/bin/apt-cyg.
It seems like Ouroboros.

I understand that, but this should mean that because apt-cyg is in /usr/local/bin already, I don't need to make a symbolic link anyway, and apt-cyg should work, right? But as I mentioned in my OP, running apt-cyg still doesn't work even when it is in /usr/local/bin, and /usr/local/bin is in the PATH.

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

Directories, which I recommend for the base of git clone, are /usr/local, /usr/local/src, /usr/local/src/github.com/kou1okada, /opt, /opt/github.com/kou1okada, etc,,,.

Maybe /usr/local/src/github.com/kou1okada is the best in this case.

Try this one:

DIR=/usr/local/src/github.com/kou1okada
mkdir -p "$DIR"
cd "$DIR"
git clone https://github.com/kou1okada/apt-cyg.git
ln -s "$(realpath apt-cyg/apt-cyg)" /usr/local/bin/

Note that if you already have /usr/local/bin/apt-cyg, don't forget to remove it before running above commands.

rm -rvfi /usr/local/bin/apt-cyg

So are you saying that it's impossible to make apt-cyg work in usr/local/bin?

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

Why you want to make a repository on /usr/local/bin?
I repeat to say that following commands do not make a script /usr/local/bin/apt-cyg but a directory.

cd /usr/local/bin &&
git clone https://github.com/kou1okada/apt-cyg.git 

The script file is /usr/local/bin/apt-cyg/apt-cyg.
And your PATH have not /usr/local/bin/apt-cyg but /usr/local/bin.

Okay, I understand what you're saying now. How about this:

cd /usr/local/src
git clone https://github.com/kou1okada/apt-cyg.git &&
ln -s "$(realpath apt-cyg/apt-cyg)" /usr/local/bin/

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024

It's O.K.
But you should consider the case that your environment never have /usr/local/src yet.
I recommend do mkdir -p /usr/local/src before you do it.

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

No.

ln -s "$(realpath ./apt-cyg)" /usr/local/bin/

The result of $(realpath ./apt-cyg) is /usr/local/src/apt-cyg.
It's directory.
The script, that you want to run, is /usr/local/src/apt-cyg/apt-cyg.

The sequence of commands that you really wanted to do is following:

DIR=/usr/local/src
mkdir -p "$DIR"
cd "$DIR"
git clone https://github.com/kou1okada/apt-cyg.git
ln -s "$(realpath apt-cyg/apt-cyg)" /usr/local/bin/

My bad, the part that you saw/quoted was an old edit that I copied without udpating. I've edited it now, and that's what I was referring to.

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

It's O.K.
But you should consider the case that your environment never have /usr/local/src yet.
I recommend do mkdir -p /usr/local/src before you do it.

Yeah, Cygwin doesn't come with /usr/local/src by default, it was the plan to make the directory first, I just wanted to make sure the rest of the commands were good. Thanks for your patient help once again.

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024

Hmm,,,
Edit makes confusing.

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024

If someone, who are reading this issue, is confused, please refer edited log too.

from apt-cyg.

hoshsadiq avatar hoshsadiq commented on August 25, 2024

Why not just download it directly? As an admin console, run the following:

curl -fsSL https://raw.githubusercontent.com/kou1okada/apt-cyg/master/apt-cyg -o /usr/local/bin/apt-cyg
chmod +x /usr/local/bin/apt-cyg

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

Coming back to this, I solved it by doing:

cd /usr/local/bin
https://github.com/kou1okada/apt-cyg.git

...and then adding:

export PATH="$PATH:/usr/local/bin/apt-cyg"

to my ~/.bash_profile.

This gives me the best of both worlds: put apt-cyg under revision control to enable upgrade-self, while installing it directly into the /usr/local/bin folder without needing to have it stored anywhere else and mess around with symbolic links.

from apt-cyg.

kou1okada avatar kou1okada commented on August 25, 2024

I repeat, my recommendation is #45 (comment).
To make repository under /usr/local/bin is not standard, maybe.
Perhaps, the bast place to make a repository is under the /opt or /usr/local/src, I think.
Filesystem Hierarchy Standard on Wikipedia may help understanding it.

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

Fair enough, but I'm trying to store apt-cyg somewhere where it's more easily accessible. How about my home directory, is that supported? I tried doing this, with a symlink to /usr/local/bin as the documentation suggests, but for some reason everytime I run apt-cyg it creates a separate apt-cyg and installation folder on my desktop instead of inside my home directory. I don't remember this behaviour occurring before, and I'd like to keep my desktop clear while keeping all of the apt-cyg stuff together in the home folder.

from apt-cyg.

hashimaziz1 avatar hashimaziz1 commented on August 25, 2024

That worked perfectly, thank you.

from apt-cyg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.