You are not logged in.

#1 2016-03-04 17:02:05

blarneyrabble
Member
Registered: 2016-03-04
Posts: 5

[SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

If I just type pacman, I get the pacman I installed from source in /usr/local/bin/pacman , which is configured incorrectly.
I do have a copy of the script in the sticky, modified for now, if anyones interested...

Here is my /etc/profile :

# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/bin:/usr/local/sbin:/usr/local/bin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
        for profile in /etc/profile.d/*.sh; do
                test -r "$profile" && . "$profile"
        done
        unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -z ${POSIXLY_CORRECT+x} && test -r /etc/bash.bashrc; then
        . /etc/bash.bashrc
fi

Last edited by blarneyrabble (2016-03-05 15:55:06)

Offline

#2 2016-03-04 17:07:09

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,806
Website

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

Try changing the order of PATH

PATH="/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/bin"

https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#3 2016-03-04 17:16:36

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

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

Remove the broken /usr/local installation?


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

#4 2016-03-04 17:23:45

blarneyrabble
Member
Registered: 2016-03-04
Posts: 5

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

Also, printenv says my path is

PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

, and when I rename /usr/local/bin/pacman to /usr/local/bin/pacman.bak , if I type pacman, its says

bash: /usr/local/bin/pacman: No such file or directory

Here is my /usr/local/bin , all of the stuff in there I put there when I was trying to fix pacman, and I'd like it gone without any errors :

-rwxr-xr-x  1 root root  21568 Feb  1 16:56 cleanupdelta
-rwxr-xr-x  1 root root  63909 Feb  1 16:56 makepkg
-rwxr-xr-x  1 root root   6536 Feb  1 16:56 makepkg-template
-rwxr-xr-x  1 root root 511312 Feb  1 16:56 pacman.bak
lrwxrwxrwx  1 root root     15 Mar  4 08:44 pacman.bak2 -> /usr/bin/pacman
-rwxr-xr-x  1 root root  11466 Feb  1 16:56 pacman-db-upgrade
-rwxr-xr-x  1 root root  23342 Feb  1 16:56 pacman-key
-rwxr-xr-x  1 root root   7003 Feb  1 16:56 pacman-optimize
-rwxr-xr-x  1 root root  39168 Feb  1 16:56 pacsort
-rwxr-xr-x  1 root root  53600 Feb  1 16:56 pactree
-rwxr-xr-x  1 root root  11164 Feb  1 16:56 pkgdelta
-rwxr-xr-x  1 root root  23106 Feb  1 16:56 repo-add
lrwxrwxrwx  1 root root      8 Feb  1 16:56 repo-elephant -> repo-add
lrwxrwxrwx  1 root root      8 Feb  1 16:56 repo-remove -> repo-add
-rwxr-xr-x  1 root root  18272 Feb  1 16:56 testpkg
-rwxr-xr-x  1 root root  23280 Feb  1 16:56 vercmp

Offline

#5 2016-03-04 17:25:00

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

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

What does `which pacman` give you?

Offline

#6 2016-03-04 21:29:10

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

blarneyrabble wrote:

If I just type pacman, I get the pacman I installed from source in /usr/local/bin/pacman , which is configured incorrectly.

How did you install pacman to /usr/local/bin/pacman?

I'd have though the course of action that you would want to take is uninstall pacman from there and then install pacman with it built using /usr/bin/pacman...


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#7 2016-03-05 15:50:42

blarneyrabble
Member
Registered: 2016-03-04
Posts: 5

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

So, I changed my PATH, in my profile, as recommended, then when I went

which pacman

I got /usr/bin/pacman, but when I tried to

pacman -Syu

it said

bash: /usr/local/bin/pacman: No such file or directory

So I opened a new terminal, and logged back in as root, and tried again, PROBLEM SOLVED!
Guess I needed to refresh the settings in the terminal window to apply the profile.
Thanks Everyone!
(I had installed pacman to /usr/local/bin/pacman either by downloading it from the arch web page and running make and make install or with the script I modified from the sticky at the top of this forum.  I'm including it at the bottom of this post, because the one in the sticky is quite old.  I guess you'd want to modify this one to install pacman in the right place if you were going to actually use it - Although I think I did something else, too, as pacman was trying to reference an arch USB stick I had in the drive as a primary source as well)
I guess what confused me about PATH was that the last entry is applied first.

Everything works now.  Not sure why I'm posting the following code.  Feel free to ignore, or use if for some reason you borked your system with yaourt like I did.

cat pacmanscript.sh
#!/bin/bash

arch=x86_64
mirror=http://mirrors.cat.pdx.edu/archlinux

# link to cache (or download) and extract: openssl,libarchive,libfetch,pacman
cd /tmp
for pkg in openssl-1.0.2.f-1 libarchive-3.1.2-8 pacman-5.0.0-1; do
    pkgname=${pkg}-${arch}.pkg.tar.xz
    if [[ -e /var/cache/pacman/pkg/${pkgname} ]]; then
        ln -sf /var/cache/pacman/pkg/${pkgname} .
    else
        wget ${mirror}/core/os/${arch}/${pkgname} || exit 1
    fi
    sudo tar -xvpf ${pkgname} -C / --exclude .PKGINFO --exclude .INSTALL || exit 1
done

# now reinstall using pacman to update the local pacman db 
sudo pacman -S --force openssl libarchive pacman || exit 1

# now update your system
sudo pacman -Syu

Offline

#8 2016-03-05 19:13:52

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

Why not simply remove Pacman from /usr/local as suggested by Wormzy?


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#9 2016-03-06 06:31:12

blarneyrabble
Member
Registered: 2016-03-04
Posts: 5

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

Removing pacman from /usr/local didn't work.  To test this I renamed it to /usr/local/bin/pacman.old (or something like that), and then tried to run pacman, and it gave me a command not found.  It couldn't find it, even though it was in /usr/bin
In retrospect, it might have worked, had I removed/renamed it and logged out of my terminal session and logged back in (or simply opened a new terminal), but removing it from /usr/local/bin , then immediately typing pacman from the same terminal, didn't work.

Offline

#10 2016-03-06 08:24:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: [SOLVED]Broke Pacman, now I need to call it with /usr/bin/pacman

When I read the first post, I thought "has he tried turning it off and on again" with some sort of smirk on my virtual face. Now after reading your most recent post, I wonder, whether that has happened in any capacity. Could you please clarify, what you have done between altering the path variable, deleting the local pacman and whatever state your system is in now?

Offline

Board footer

Powered by FluxBB