You are not logged in.

#1 2022-02-18 20:50:53

D-meist
Member
Registered: 2022-02-18
Posts: 6

Installing using aur/git/makepkg and environment variables

I'm fairly new to linux so I'm trying to understand how environment variables work. I used the aur to install vysor-bin. I ran the command (my pwd was /home/daniel/Downloads/vysor-bin/) sudo pacman -U against the .zst file. It installed Vysor just fine and I could launch it using rofi. When I tried entering the command vysorapp from terminal I got bash: vysorapp: command not found. So I wondered, "Where did the installer put the executable?" I ran sudo find / -name vysorapp and it returned two paths:

/opt/Vysor/vysorapp
/home/daniel/Downloads/vysor-bin/pkg/vysor-bin/opt/Vysor/vysorapp

As I'm trying to create an sxhkd hotkey to launch it, I could just

#Vysor
super + v
     /home/daniel/Downloads/vysor-bin/pkg/vysor-bin/opt/Vysor/vysorapp

But that seems kludgy to me...it feels like an executable doesn't belong in my Downloads folder ya know. What would I need to do differently to get vysorapp to just run. What I mean is when I type touch into the terminal it's referencing something somewhere else not in my current working directory and I'm guessing that's based on environment variables. Any help would be appreciated.

Thanks,

-Daniel

Last edited by D-meist (2022-02-18 21:19:57)

Offline

#2 2022-02-18 21:07:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Installing using aur/git/makepkg and environment variables

Please edit your title so that it actually reflects your issue: https://wiki.archlinux.org/title/Genera … ow_to_post

You can use pacman to list all the files it installs: see the man page.

Your issue is about your PATH https://wiki.archlinux.org/title/Enviro … s#Per_user


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2022-02-18 21:12:12

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: Installing using aur/git/makepkg and environment variables

You are right.  Packages should not touch anything in your home folder.  Ever.  <EDIT> and by that I mean the package should never direct pacman to install anything in $HOME </EDIT>
How did you build the package?  If you built the package in vysorapp, then all of the artifacts of that build, including the executable that is loaded into the package you are building will exist in the pkg directory.  Your path does not include these pkg directories.   They are merely an artifact of your having built it.  Most of us have a dedicated build directory for this, I don't recommend using the downloads directory.

Two commands you might have used in your exploration:

What is the output of which vysorapp  ?   It tells you which file is invoked when you run the program by name from your shell

Also, what is the output of pacman -Ql vysorapp   (Assuming that is the package name.)  Tells you about each file in the package and where it exists in the file system.

Last edited by ewaller (2022-02-18 21:13:50)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2022-02-18 21:26:59

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Installing using aur/git/makepkg and environment variables

The PKGBUILD downloads a .deb then unpacks data.tar.xz but it misses the postinst script that includes this line:

ln -sf '/opt/Vysor/vysorapp' '/usr/bin/vysorapp'

^ That will make the command available without having to add /opt/Vysor/ to PATH. Remember to remove the symlink if you ever uninstall the package. EDIT: or ask the maintainer to add a .install script to the package.

This might also be useful:

# SUID chrome-sandbox for Electron 5+
chmod 4755 '/opt/Vysor/chrome-sandbox' || true

The '|| true' bit is just to ensure the postinst script doesn't fail if the permissions are already correct so you can omit that.

However it does add the setuid bit. In fact the whole thing looks terrible from a security perspective. But I'm no expert.

Last edited by Head_on_a_Stick (2022-02-18 21:44:00)

Offline

#5 2022-02-18 21:47:32

D-meist
Member
Registered: 2022-02-18
Posts: 6

Re: Installing using aur/git/makepkg and environment variables

Here's what I did:

[daniel@Linigo Downloads]$ pwd
/home/daniel/Downloads
[daniel@Linigo Downloads]$ git clone https://aur.archlinux.org/vysor-bin.git
Cloning into 'vysor-bin'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 28 (delta 11), reused 28 (delta 11), pack-reused 0
Receiving objects: 100% (28/28), 8.22 KiB | 8.22 MiB/s, done.
Resolving deltas: 100% (11/11), done.
[daniel@Linigo Downloads]$ cd vysor-bin/
[daniel@Linigo vysor-bin]$ makepkg -s
==> Making package: vysor-bin 4.1.77-1 (Fri 18 Feb 2022 01:26:19 PM PST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading Vysor-linux-4.1.77.deb...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   659  100   659    0     0   1770      0 --:--:-- --:--:-- --:--:--  1771
100 62.3M  100 62.3M    0     0  19.2M      0  0:00:03  0:00:03 --:--:-- 25.6M
==> Validating source files with sha256sums...
    Vysor-linux-4.1.77.deb ... Passed
==> Extracting sources...
  -> Extracting Vysor-linux-4.1.77.deb with bsdtar
==> Entering fakeroot environment...
==> Starting package()...
  -> Extracting the data.tar.xz...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "vysor-bin"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: vysor-bin 4.1.77-1 (Fri 18 Feb 2022 01:26:28 PM PST)
[daniel@Linigo vysor-bin]$ sudo pacman -U vysor-bin-4.1.77-1-x86_64.pkg.tar.zst
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (1)  New Version  Net Change

vysor-bin    4.1.77-1     227.69 MiB

Total Installed Size:  227.69 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [-------------------------] 100%
(1/1) checking package integrity                   [-------------------------] 100%
(1/1) loading package files                        [-------------------------] 100%
(1/1) checking for file conflicts                  [-------------------------] 100%
(1/1) checking available disk space                [-------------------------] 100%
:: Processing package changes...
(1/1) installing vysor-bin                         [-------------------------] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
[daniel@Linigo vysor-bin]$ ls
pkg  PKGBUILD  src  vysor-bin-4.1.77-1-x86_64.pkg.tar.zst  Vysor-linux-4.1.77.deb


[daniel@Linigo vysor-bin]$ which vysorapp
which: no vysorapp in (/home/daniel/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)

[daniel@Linigo vysor-bin]$ sudo pacman pacman -Ql vysorapp
error: package 'vysorapp' was not found

Offline

#6 2022-02-18 21:56:08

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: Installing using aur/git/makepkg and environment variables

So the package name is, so the command should be pacman -Ql vysor-bin


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2022-02-18 22:04:54

D-meist
Member
Registered: 2022-02-18
Posts: 6

Re: Installing using aur/git/makepkg and environment variables

[daniel@Linigo vysor-bin]$ pacman -Ql vysor-bin
[sudo] password for daniel:
vysor-bin /opt/
vysor-bin /opt/Vysor/
vysor-bin /opt/Vysor/LICENSE.electron.txt
vysor-bin /opt/Vysor/LICENSES.chromium.html
vysor-bin /opt/Vysor/chrome-sandbox
vysor-bin /opt/Vysor/chrome_100_percent.pak
vysor-bin /opt/Vysor/chrome_200_percent.pak
vysor-bin /opt/Vysor/icudtl.dat
vysor-bin /opt/Vysor/libEGL.so
vysor-bin /opt/Vysor/libGLESv2.so
vysor-bin /opt/Vysor/libffmpeg.so
vysor-bin /opt/Vysor/libvk_swiftshader.so
vysor-bin /opt/Vysor/libvulkan.so.1
vysor-bin /opt/Vysor/locales/
vysor-bin /opt/Vysor/locales/am.pak
vysor-bin /opt/Vysor/locales/ar.pak
vysor-bin /opt/Vysor/locales/bg.pak
vysor-bin /opt/Vysor/locales/bn.pak
vysor-bin /opt/Vysor/locales/ca.pak
vysor-bin /opt/Vysor/locales/cs.pak
vysor-bin /opt/Vysor/locales/da.pak
vysor-bin /opt/Vysor/locales/de.pak
vysor-bin /opt/Vysor/locales/el.pak
vysor-bin /opt/Vysor/locales/en-GB.pak
vysor-bin /opt/Vysor/locales/en-US.pak
vysor-bin /opt/Vysor/locales/es-419.pak
vysor-bin /opt/Vysor/locales/es.pak
vysor-bin /opt/Vysor/locales/et.pak
vysor-bin /opt/Vysor/locales/fa.pak
vysor-bin /opt/Vysor/locales/fi.pak
vysor-bin /opt/Vysor/locales/fil.pak
vysor-bin /opt/Vysor/locales/fr.pak
vysor-bin /opt/Vysor/locales/gu.pak
vysor-bin /opt/Vysor/locales/he.pak
vysor-bin /opt/Vysor/locales/hi.pak
vysor-bin /opt/Vysor/locales/hr.pak
vysor-bin /opt/Vysor/locales/hu.pak
vysor-bin /opt/Vysor/locales/id.pak
vysor-bin /opt/Vysor/locales/it.pak
vysor-bin /opt/Vysor/locales/ja.pak
vysor-bin /opt/Vysor/locales/kn.pak
vysor-bin /opt/Vysor/locales/ko.pak
vysor-bin /opt/Vysor/locales/lt.pak
vysor-bin /opt/Vysor/locales/lv.pak
vysor-bin /opt/Vysor/locales/ml.pak
vysor-bin /opt/Vysor/locales/mr.pak
vysor-bin /opt/Vysor/locales/ms.pak
vysor-bin /opt/Vysor/locales/nb.pak
vysor-bin /opt/Vysor/locales/nl.pak
vysor-bin /opt/Vysor/locales/pl.pak
vysor-bin /opt/Vysor/locales/pt-BR.pak
vysor-bin /opt/Vysor/locales/pt-PT.pak
vysor-bin /opt/Vysor/locales/ro.pak
vysor-bin /opt/Vysor/locales/ru.pak
vysor-bin /opt/Vysor/locales/sk.pak
vysor-bin /opt/Vysor/locales/sl.pak
vysor-bin /opt/Vysor/locales/sr.pak
vysor-bin /opt/Vysor/locales/sv.pak
vysor-bin /opt/Vysor/locales/sw.pak
vysor-bin /opt/Vysor/locales/ta.pak
vysor-bin /opt/Vysor/locales/te.pak
vysor-bin /opt/Vysor/locales/th.pak
vysor-bin /opt/Vysor/locales/tr.pak
vysor-bin /opt/Vysor/locales/uk.pak
vysor-bin /opt/Vysor/locales/vi.pak
vysor-bin /opt/Vysor/locales/zh-CN.pak
vysor-bin /opt/Vysor/locales/zh-TW.pak
vysor-bin /opt/Vysor/resources.pak
vysor-bin /opt/Vysor/resources/
vysor-bin /opt/Vysor/resources/app.asar
vysor-bin /opt/Vysor/resources/app.asar.unpacked/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/android/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/android/Vysor-release.8f557058eb220b2fe734365a1dd1ff01ccb6cccee1845c6a33b80c70c30b89c4.apk
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/common/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/common/icon.png
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/electron/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/electron/android_checkin.proto
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/electron/checkin.proto
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/electron/mcs.proto
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/electron/safemode.html
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/linux/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/linux/adb
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/linux/tray-light.png
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/linux/tray.png
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/linux/video_decode.so
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/pnacl/
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/pnacl/video_decode.pexe
vysor-bin /opt/Vysor/resources/app.asar.unpacked/native/video_decode.nmf
vysor-bin /opt/Vysor/snapshot_blob.bin
vysor-bin /opt/Vysor/swiftshader/
vysor-bin /opt/Vysor/swiftshader/libEGL.so
vysor-bin /opt/Vysor/swiftshader/libGLESv2.so
vysor-bin /opt/Vysor/v8_context_snapshot.bin
vysor-bin /opt/Vysor/vk_swiftshader_icd.json
vysor-bin /opt/Vysor/vysorapp
vysor-bin /usr/
vysor-bin /usr/share/
vysor-bin /usr/share/applications/
vysor-bin /usr/share/applications/vysorapp.desktop
vysor-bin /usr/share/doc/
vysor-bin /usr/share/doc/vysor/
vysor-bin /usr/share/doc/vysor/changelog.gz
vysor-bin /usr/share/icons/
vysor-bin /usr/share/icons/hicolor/
vysor-bin /usr/share/icons/hicolor/1024x1024/
vysor-bin /usr/share/icons/hicolor/1024x1024/apps/
vysor-bin /usr/share/icons/hicolor/1024x1024/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/128x128/
vysor-bin /usr/share/icons/hicolor/128x128/apps/
vysor-bin /usr/share/icons/hicolor/128x128/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/16x16/
vysor-bin /usr/share/icons/hicolor/16x16/apps/
vysor-bin /usr/share/icons/hicolor/16x16/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/24x24/
vysor-bin /usr/share/icons/hicolor/24x24/apps/
vysor-bin /usr/share/icons/hicolor/24x24/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/256x256/
vysor-bin /usr/share/icons/hicolor/256x256/apps/
vysor-bin /usr/share/icons/hicolor/256x256/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/32x32/
vysor-bin /usr/share/icons/hicolor/32x32/apps/
vysor-bin /usr/share/icons/hicolor/32x32/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/48x48/
vysor-bin /usr/share/icons/hicolor/48x48/apps/
vysor-bin /usr/share/icons/hicolor/48x48/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/512x512/
vysor-bin /usr/share/icons/hicolor/512x512/apps/
vysor-bin /usr/share/icons/hicolor/512x512/apps/vysorapp.png
vysor-bin /usr/share/icons/hicolor/64x64/
vysor-bin /usr/share/icons/hicolor/64x64/apps/
vysor-bin /usr/share/icons/hicolor/64x64/apps/vysorapp.png

Offline

#8 2022-02-18 22:32:16

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Installing using aur/git/makepkg and environment variables

Please edit your posts and put [⁣code] [⁣/code] tags around all commands and their outputs, it makes things much easier to read for everyone.
https://bbs.archlinux.org/help.php#bbcode

Thanks


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2022-02-18 22:37:20

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: Installing using aur/git/makepkg and environment variables

Head_on_a_Stick wrote:

The PKGBUILD downloads a .deb then unpacks data.tar.xz but it misses the postinst script that includes this line:

ln -sf '/opt/Vysor/vysorapp' '/usr/bin/vysorapp'

^ That will make the command available without having to add /opt/Vysor/ to PATH. Remember to remove the symlink if you ever uninstall the package. EDIT: or ask the maintainer to add a .install script to the package.

Or add the link in package()

Head_on_a_Stick wrote:

This might also be useful:

# SUID chrome-sandbox for Electron 5+
chmod 4755 '/opt/Vysor/chrome-sandbox' || true

The '|| true' bit is just to ensure the postinst script doesn't fail if the permissions are already correct so you can omit that.

However it does add the setuid bit. In fact the whole thing looks terrible from a security perspective. But I'm no expert.

https://github.com/archlinux/svntogit-p … BUILD#L214
I believe it is needed so the sandbox can create a custom namespace and user namespaces may be disabled.

Offline

#10 2022-02-18 22:39:39

D-meist
Member
Registered: 2022-02-18
Posts: 6

Re: Installing using aur/git/makepkg and environment variables

Head_on_a_Stick wrote:

The PKGBUILD downloads a .deb then unpacks data.tar.xz but it misses the postinst script that includes this line:

ln -sf '/opt/Vysor/vysorapp' '/usr/bin/vysorapp'

^ That will make the command available without having to add /opt/Vysor/ to PATH. Remember to remove the symlink if you ever uninstall the package. EDIT: or ask the maintainer to add a .install script to the package.

This might also be useful:

# SUID chrome-sandbox for Electron 5+
chmod 4755 '/opt/Vysor/chrome-sandbox' || true

The '|| true' bit is just to ensure the postinst script doesn't fail if the permissions are already correct so you can omit that.

However it does add the setuid bit. In fact the whole thing looks terrible from a security perspective. But I'm no expert.

I don't really understand enough about linux to understand the 2nd half of your post, but the first half makes sense. I'll make the link myself. Thank you.

Offline

#11 2022-02-18 22:41:58

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Installing using aur/git/makepkg and environment variables

No, don't make the link yourself and don't put it in the post_install script. It needs to be done in the package function so the link is part of the package. Let the maintainer know.

Offline

#12 2022-02-18 23:00:27

D-meist
Member
Registered: 2022-02-18
Posts: 6

Re: Installing using aur/git/makepkg and environment variables

I will send a link of this forum post to the maintainer.

Offline

#13 2022-02-19 00:18:15

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: Installing using aur/git/makepkg and environment variables

Slithery wrote:

Please edit your posts and put [⁣code] [⁣/code] tags around all commands and their outputs, it makes things much easier to read


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#14 2022-02-19 14:17:27

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Installing using aur/git/makepkg and environment variables

Scimmia wrote:

don't put it in the post_install script. It needs to be done in the package function so the link is part of the packag.

For clarity: the .deb also include a postrm script that removes the symlink and so a post_remove function could also be added to the .install script to mimic that. But I agree it makes more sense to add it to the package() function.

Offline

#15 2022-02-19 14:47:29

D-meist
Member
Registered: 2022-02-18
Posts: 6

Re: Installing using aur/git/makepkg and environment variables

Got a hold of the maintainer and he made the change. Uninstalled, reinstalled, and it works now. smile

Offline

#16 2022-02-19 15:38:10

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: Installing using aur/git/makepkg and environment variables

Please mark your thread as solved and edit your posts as previously requested.

https://wiki.archlinux.org/title/Genera … ow_to_post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB