Skip to content

AUR4 bashrc snippet

I've created a small bash/zsh snippet for anyone who wants to download and build packages from the new aur(4). This downloads packages similar to cower with the '-d' option, but for the git-based AUR.

Place one or both snippets in your .bashrc or .zshrc to use.

# download the aur(4) package to the current directory, similar to cower -d from the old AUR, but using the officially supported method; git.
# usage:
# $ aurd <package-name>
aurd() {
    git clone https://aur4.archlinux.org/$1.git/ 
    #git clone ssh://aur@aur4.archlinux.org/$1.git/
}    

# download the aur(4) package to the current directory, cd, build (clean) and prompt to install.
aurb() {
    git clone https://aur4.archlinux.org/$1.git/ && cd $1 && makepkg -sci 
    #git clone ssh://aur@aur4.archlinux.org/$1.git/ && cd $1 && makepkg -sci 
}
4 points8 comments
Open on Reddit
About this post
Posted
Archived
Score
4 · 100% up
Kind
Text
ID
397uwp

Author

2
posts
35
comments
1
media
View profile

8 comments

To update packages, simply alias add the function:

# update the package in the current directory
auru() {
    git pull && rm -f *.pkg.tar.xz || true && makepkg -sci
}
2 points

Does this mean we won't need programs like yaourt to manage AUR installations?

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.