Try this:
- Save the script as
apt-proxy(without the.shextension) in some directory, like~/bin. - Add
~/binto yourPATH, typingexport PATH=$PATH:~/bin - If you need it permanently, add that last line in your
~/.bashrc. If you’re usingzsh, then add it to~/.zshrcinstead. - Then you can just run
apt-proxywith your arguments and it will run anywhere.
Note that if you export the PATH variable in a specific window it won’t update in other bash instances.