# Running Command Line Application in Fedora Linux ARM using Rosetta 2 ## Running steps ### Setup Rosseta 2 in Linux as shown in [01_rosetta2_fedora_linux_vm.md](https://gist.github.com/kid1412-net/362ed2c3b089a25f3667a27183da63e6#file-01_rosetta2_fedora_linux_vm-md) ### Install neccesary Linux x86-64 libraries ``` sudo mkdir /opt/packages sudo dnf install glibc glibc.i686 libstdc++ --releasever=/ --forcearch=x86_64 --installroot=/opt/packages -y ``` ### Create a symbolic link to Linux x86-64 library ``` sudo ln -s /opt/packages/lib64/ld-linux-x86-64.so.2 /lib64/ ``` ### Download unrar Linux x86-64 binary ``` cd Downloads wget https://www.rarlab.com/rar/rarlinux-x64-621.tar.gz ``` ### Extract unrar Linux x86-64 binary ``` tar -xvzf rarlinux-x64-621.tar.gz -C . ``` ### Check rar binary architecture ``` file rar/rar rar: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped ``` ### Try to get help of rar Linux x86-64 binary ``` cd rar LD_LIBRARY_PATH=/opt/packages/lib64 ./unrar /h UNRAR 6.21 freeware Copyright (c) 1993-2023 Alexander Roshal Usage: unrar - - <@listfiles...> e Extract files without archived paths l[t[a],b] List archive contents [technical[all], bare] p Print file to stdout t Test archive files v[t[a],b] Verbosely list archive contents [technical[all],bare] x Extract files with full path ... ``` ### Try to use rar to compress, uncompress and compare the result ``` md5sum rarlinux-x64-621.tar.gz d31ef68b281179d29729aaa81d232b9c rarlinux-x64-621.tar.gz LD_LIBRARY_PATH=/opt/packages/lib64 rar a -p123456 rar612.rar rarlinux-x64-621.tar.gz mkdir back mv rarlinux-x64-621.tar.gz back/ LD_LIBRARY_PATH=/opt/packages/lib64 unrar x rar612.rar md5sum rarlinux-x64-621.tar.gz d31ef68b281179d29729aaa81d232b9c rarlinux-x64-621.tar.gz ``` ## Script to automatically setup Rosetta 2 in Fedora Linux ARM [80_rosetta2_fedora_setup.sh](#file-80_rosetta2_fedora_setup-sh) or https://bit.ly/kidrosetta2 ## References - [[wikipedia.org] List of proprietary software for Linux ](https://en.wikipedia.org/wiki/List_of_proprietary_software_for_Linux) - [[bugzilla.redhat.com] Bug 1190854 - allow overriding $arch and $basearch via CLI](https://bugzilla.redhat.com/show_bug.cgi?id=1190854) - [[linuxhint.com] How to Install Package to a Specific Directory Using Yum ](https://linuxhint.com/install-package-to-a-specific-directory-using-yum/) ## History - 2023/Mar/23: Newly create