Linux apt-get command not found - How to install a package in Arch Linux? - archlinux

I am trying to install a command:
$ sudo -s apt-get install net-tools
/bin/bash: apt-get: command not found
How can I install apt-get then?
I use command below to find Out My Linux Distribution Name and Version:
$ cat /etc/*-release
I get this below:
NAME="Arch Linux"
ID=arch
PRETTY_NAME="Arch Linux"
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
Any ideas what should I do to install a command in Arch Linux?

First of all, Arch provides a beautiful, well maintained wiki. You may want to read it first before working with Arch. The pre-installed package manager is "pacman".
To install a package from the official repositories, you will need to use it like this:
# pacman -S <package name>
There is also a community maintained version, the Arch User Repository, for packages not part of the official repository.

I used this page https://wiki.archlinux.org/index.php/Pacman_Rosetta when I moved to Arch linux, it lists the equivalent commands for various common package managers, including apt and pacman.
For example:
+-----------------------+-------------+----------------+-------------------------+----------------+-----------------+
| Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
+-----------------------+-------------+----------------+-------------------------+----------------+-----------------+
| Install a package(s) | pacman -S | dnf install | apt install | zypper install | emerge [-a] |
| Remove a package(s) | pacman -Rs | dnf remove | apt remove | zypper remove | emerge -C |
| Search for package(s) | pacman -Ss | dnf search | apt search | zypper search | emerge -S |
| Upgrade Packages | pacman -Syu | dnf upgrade | apt update; apt upgrade | zypper update | emerge -u world |
| ... |

If you really want to download apt, then:
Install pacaur
$ pacman -S pacaur
Install apt, from pacaur (no root)
$ pacaur -S apt
Add some repositories
Now you have working apt on arch linux

Arch linux does not generally use the apt package manager. It uses pacman:
https://wiki.archlinux.org/index.php/Pacman

You can't. Arch does not use the apt package system unlike Debian-based linuxes, like Ubuntu. Instead it uses the pacman package manager. However, you should try it out. Using pacman myself, I never had a problem with it, and you can still use it in order to install packages that you can get with the apt package manager.

As #Marcus mentioned, pacman is the builtin package manager. However, it won't give you access to AUR packages.
aurman is a nice wrapper that also searches and installs from AUR. yaourt used to be popular but according to the AUR wiki it is insecure and not featurefull. aurman cli works almost exactly like pacman so you can follow a pacman guide just the same. To get aurman:
cd ~/Downloads
git clone https://aur.archlinux.org/aurman.git
cd aurman
makepkg -Acs
# Change xxx below to downloaded version
sudo pacman -U aurman-xxx.pkg.tar.xz
Then, you can follow something like https://www.digitalocean.com/community/tutorials/how-to-use-arch-linux-package-management which I also pasted into this stackexchange answer here: https://raspberrypi.stackexchange.com/questions/510/how-do-i-install-packages-from-the-aur/84216
aurman can also be found on github: https://github.com/polygamma/aurman

Arch Linux does NOT use apt or apt-get, instead, however, it uses pacman. the syntax for pacman is quite different than apt-get; it uses -S to install packages instead of install. eg: sudo pacman -S [package].
Learn more at the man page or maybe type --help, wiki: https://wiki.archlinux.org/title/pacman

Related

Trying to uninstall JDK in Arch Linux

I'm trying to remove all the JDK's in my computer and only install the LTS version (JDK11).
When i run:
archlinux-java status
I get 3 environments (screenshot).
When i run pacman -Qe no JDK is listed, and when i run pacman -R openjdk14 the terminal returns "No package was found", but when i run java -version the OpenJDK-14 is listed (screenshot). How can i remove all the JDK's in my arch system?
Use pacman -Q | grep jre to find the names of the Java packages installed. The switch -e limits the output to explicit installed packages. In order to find everything you should'nt use any filters:
neon: ~ $ pacman -Qe | grep jre
neon: ~ $ pacman -Q | grep jre
jre-openjdk 14.0.2.u12-1
jre-openjdk-headless 14.0.2.u12-1
To remove a package use pacman -R <package name> or pacman -Rs <package name> if you want to remove unused dependencies as well.
Try the following command
sudo pacman -R jre14-openjdk

how to install mono latest Alpha version on Ubuntu 16.04

I tried to do the guide on the mono website, but I don't really understand it as I am not a linux guy and surely not an expert in servers.
I don't find anything on Google.
No matter what I do, when I use the "mono --version" command to see if the install was successful, I get Mono 4.6.1
If you are looking for alpha versions, you will want to setup your package manager to pull the Mono Continuous Integration packages as these are built for every commit to the repo at https://github.com/mono/mono.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://jenkins.mono-project.com/repo/debian sid main" | sudo tee /etc/apt/sources.list.d/mono-jenkins.list
sudo apt-get update
Ref: http://www.mono-project.com/docs/getting-started/install/linux/ci-packages/#debian-ubuntu-and-derivatives
Read the Usage section on how to select a build/package.

Download mono-complete and install it on another new machine

I Downloaded mono-complete 3.10 by adding following repository and signing key in synaptic. After Downloading mono-complete-3.10, I installed this package in another fresh machine, but in fresh machine it gives lot of errors. Please suggest me how to install this downloaded package on another machine (offline).
Repo:
echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.10.0 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
Signing Key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
I see different versions of ubuntu in your tags.On what version of ubuntu you are installing your mono? Did you fully read this article?
Why don't you just use smth like apt-get install mono-complete monodevelop e.g.?

Correct install for RVM and Chef

I installed rvm for multi-user on my server.
\curl -sSL https://get.rvm.io | sudo bash -s stable
sudo usermod -a -G
rvm ubuntu rvm install 2.1.1
rvm --default use 2.1.1
I also installed Chef
curl -L https://www.opscode.com/chef/install.sh | sudo bash
But when i run "gem install chef" under ubuntu i get
You don't have write permissions into the /opt/chef/embedded/lib/ruby/gems/1.9.1 directory
Obviously i can just change the permissions but I'm assuming this isn't how i should set this up.
Any help would be greatly appreciated.
The omnibus installer, aka:
curl -L https://www.opscode.com/chef/install.sh | sudo bash
Installs Chef for you. You don't need to install Chef. You can run chef as chef-client or chef-solo.
Chef get's installed into /opt/chef and it packages it's own Ruby, etc.
With respect to your RVM issues:
Have you added the required lines to your .bashrc?
Are you actually executing a login shell (-l)?
Why are you trying to install chef into rvm?

Compiling libapache2-svn for Apache 2.4.4

I want to use Apache 2.4.4 with SVN on Ubuntu server 12.04 (Precise Pangolin). But when I use
apt-get install libapache2-svn
I get the following dependencies error
The following packages have unmet dependencies:
libapache2-svn : Depends: apache2.2-common but it is not going to be installed
Googling around I got some suggestion about compiling from source by hand. I don't know how to do that. How can I do it?
I have two solutions:
Follow the instructions in this Server Fault Q&A.
*Note: Create another user if you're using a root account on the server.
I've asked Ondřej Surý on Launchpad to add Subversion to his Apache PPA. You can add Ondřej Surý's PPA to perform a normal update/upgrade.
You did ask Ondrej to include Subversion in his PPA launchpad. But I couldn't install the libapache2-svn package after adding Ondrej's PPA.
Somehow the instructions provided for compiling didn't work for me so here's an alternative way to get it working.
Reference:
(https://askubuntu.com/questions/312568/where-can-i-find-a-subversion-1-8-binary)
WANDisco has Subversion 1.8 for Ubuntu then:
sudo sh -c 'echo "# WANdisco Open Source Repo" >> /etc/apt/sources.list.d/WANdisco.list'
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/WANdisco.list'
wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
After that:
apt-cache show subversion | grep '^Version:'
And then you should be good to install normally:
sudo apt-get install subversion libapache2-svn