Can't install

cgmnetworktv@https-watch-koinonia-club:/var/www/peertube/peertube-latest$ yarn version
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'version'

Hmm ok. Are you on a WSL (Windows Subsystem for Linux ) ?

this is a pure vanilla Ubuntu server on gcp. I haven’t installed any WSL.

OK, I was just curious.

I found this blog page: https://blog.yannickreekmans.be/get-yarn-v1-to-work-in-ubuntu-20-04-on-windows-subsystem-for-linux-v2/

The reason of my question :slight_smile:

But I think this is the same problem that has happened to that person. A yarn package has already been installed whilst this was not the good yarn (package manager)

Do this:

sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install --no-install-recommends yarn
cgmnetworktv@https-watch-koinonia-club:/var/www/peertube/peertube-latest$ sudo apt remove cmdtest
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python3-cliapp python3-markdown python3-packaging python3-pygments python3-pyparsing python3-ttystatus
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  cmdtest
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 98.3 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 111507 files and directories currently installed.)
Removing cmdtest (0.32.14.gcdfe14e-1) ...
Processing triggers for man-db (2.9.1-1) ...
  ...
  inflating: peertube-v2.4.0/tsconfig.json  
  inflating: peertube-v2.4.0/yarn.lock  
cgmnetworktv@https-watch-koinonia-club:/var/www/peertube$ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
ln: failed to create symbolic link './peertube-latest': Permission denied

the ln -s... has already been done in your previous steps. you just have to go on with cd peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile and next steps

cgmnetworktv@https-watch-koinonia-club:/var/www/peertube$ cd peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
sudo: yarn: command not found

did you run each those commands next the sudo apt remove cmdtest ?

sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install --no-install-recommends yarn
cgmnetworktv@https-watch-koinonia-club:/var/www/peertube$ sudo apt remove yarn
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'cmdtest' instead of 'yarn'
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Hit:1 http://us-east1.gce.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us-east1.gce.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]       
Get:3 http://us-east1.gce.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]    
Hit:4 http://archive.canonical.com/ubuntu focal InRelease                                  
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]                  
Get:6 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]                    
Get:7 http://us-east1.gce.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [374 kB]
Get:8 http://us-east1.gce.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [170 kB]
Get:9 https://dl.yarnpkg.com/debian stable/main amd64 Packages [10.1 kB]
Get:10 https://dl.yarnpkg.com/debian stable/main all Packages [10.1 kB]
Fetched 898 kB in 1s (1296 kB/s)     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  yarn
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 891 kB of archives.
After this operation, 5407 kB of additional disk space will be used.
Get:1 https://dl.yarnpkg.com/debian stable/main amd64 yarn all 1.22.5-1 [891 kB]
Fetched 891 kB in 0s (6019 kB/s)
Selecting previously unselected package yarn.
(Reading database ... 111115 files and directories currently installed.)
Preparing to unpack .../archives/yarn_1.22.5-1_all.deb ...
Unpacking yarn (1.22.5-1) ...
Setting up yarn (1.22.5-1) ...
cgmnetworktv@https-watch-koinonia-club:/var/www/peertube$ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
ln: failed to create symbolic link './peertube-latest': Permission denied

ok, now yarn seems installed.

but the command you run for peertube is not the right one at that time. you should go on with the install procedure by doing

  1. cd /var/www/peertube/
  2. cd peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
  3. Continue with the rest of the installation process