15

I am trying to install a command in a terminal window:

sudo -s apt-get install net-tools

Result:

/bin/bash: apt-get: command not found

How can I install apt-get then?

I use the 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/"

What should I do to install a command in Arch Linux?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Run
  • 54,938
  • 169
  • 450
  • 748
  • 1
    http://stackoverflow.com/questions/43124985/arch-linux-apt-get-update-equivalent-command/43127573#43127573 This should help you. – Deanie Apr 13 '17 at 22:10

7 Answers7

30

First of all, Arch Linux provides a beautiful, well maintained wiki. You may want to read it first before working with Arch Linux. 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 (AUR), for packages not part of the official repository.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Marcus
  • 922
  • 6
  • 21
9

I used page 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 Linux
 
Red Hat Linux/
Fedora
Debian/
Ubuntu
SLES/
openSUSE
Gentoo Linux
 
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
...
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Hany Alsamman
  • 491
  • 6
  • 20
  • 1
    I don't think "converts ... common package manager commands including apt to pacman" describes what happens. That feels like "apt update" _converts_ to "pacman update", which it doesn't. – Marcus Mar 03 '17 at 13:58
  • 2
    @Marcus I don't mean what you understood, the table in the link showing each command in ubuntu and Arch , `apt upgrade -> pacman -Syu` – Hany Alsamman Mar 03 '17 at 14:17
8

If you really want to download APT, then:

  1. Install pacaur:

    pacman -S pacaur

  2. Install APT, from pacaur (no root)

    pacaur -S apt

  3. Add some repositories

  4. Now you have a working APT on Arch Linux

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
M KJJJ
  • 117
  • 2
  • 3
  • 3
    is there any downside to this approach? Also I see error: target not found: pacaur on the version of Arch linux that comes with RuneAudio running on Raspberry PI. – Tomachi Aug 01 '20 at 13:19
2

You can't. Arch Linux 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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • It isn't true that you can't use apt on Arch. You can install apt from the AUR. I am working on maintaining both deb and rpm packages for a tool I develop, and one of the great things about Arch is that you can install both dpkg/apt and rpm/(yum|dnf). However, I definitely recommend using pacaur to manage software that you aren't just testing. – Patrick Feb 18 '20 at 15:36
1

Arch Linux does not generally use the APT package manager. It uses Pacman.

See the Arch wiki: Pacman

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
PenguMC
  • 86
  • 4
0

As Marcus mentioned, Pacman is the built-in 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 featureful.

  • 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 How to use Arch Linux package management which I also pasted into this Stack Exchange answer here: How do I install packages from the AUR?

aurman can also be found on GitHub: aurman - AUR helper with almost pacman syntax

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mjd2
  • 321
  • 1
  • 2
  • 13
0

Arch Linux does not use APT (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. For example, sudo pacman -S [package].

Learn more at the man page or maybe type --help. Or on the wiki: Pacman

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
TechTycho
  • 134
  • 1
  • 10