Site icon Take On Devops

COMMON PROBLEMS FACED BY ARCH LINUX USERS.

When it comes to arch installation, post installation and regular usage there may be many problems that users will have to deal with. Interestingly there are not many posts/ forums that address these problems properly or clarify the solution clearly. So I feel obliged to write a post so that maybe one day someone will not have to go through all the trouble spending a lot of time & plucking their hair trying to overcome these problems. After all, linux is all about community based improvements. Did you know that the term ‘Ubuntu’ means humanity or humanity towards others? 🙂

So lets get right into it.

1. No Internet 🙁 .

This issue can occur during arch installation as well. It would display unable to resolve host and you would be unable to download packages for the install.The most common reason for this is due the fact that dhcp daemon is not running. Type the following, which should solve your problem.

sudo dhcpcd

Also if that fixed your problem. Then you may want to prevent it from happening again. Run these commands unless you want to manually start it everytime you log in 😀

sudo systemctl enable dhcpcd

2. Download Mirrors, taking too long to download packages.

More often than not, when you use the default mirrorlist, you are going to experience speeds of around 10Kbps. So it may take long time to even download even the small packages. You may then have tried to prioritize the mirrors according to your location, still you would find that there were no improvements. So here is how you do it:

rankmirrors -v /etc/pacman.d/mirrorlist

The above command will give you the times taken by each mirror. You can then prioritize and add those to the top of your mirrorlist file.

3. Downloading unsupported packages

Apart from supported packages, users may want to install other packages. So most of those packages are in .deb format as opposed to packages in .tar.xz format which could be simply installed with the command

sudo pacman -U

So when it is in .deb how you can install them is by converting the .deb to a tar.xz file. To do this, there is a script which is similar to the Alien tool which converts .rpm files to .deb. The script that you need for this task is a script called debtap. You can clone it into a folder you want from GitHub. When you try to clone, you may realize that even git commands don’t work 😀 , then first you should run,

sudo pacman -S git

after which you can execute the following commands.

git clone https://github.com/helixarch/debtap

Once it has been cloned, go into that directory and run

./debtap

Which will create a tar.xz file. Now all that is left is to install the .tar.xz. To do this run,

sudo pacman -U

4. Problems in using yaourt

This one is really hard to tackle, with many users facing different variations of the same problem. But there seems to be no clear solution at all. All that people do when it comes to this topic is that they argue about what caused this : Pacman version 4.2 disabling the –asroot function for makepkg.

So I managed to think things through and rig out a solution. Which apparently is the most sensible solution that Arch Developers expect us to use, but that has not understood by many.

If you were to run yaourt to install a package, you’d most likely end up with an error if it is a recent version of pacman you have. part of the error will look like this :

Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system

Now this error maybe preceded by few other errors or there may be errors following the above error. But the above error that is generic. Most probably if the above error is fixed, All your issues maybe fix. But if that is not the case, you will have to fix them yourself. (They are not very hard to solve). Just as I have stated at first you cannot run the makepkg as root. Hence the error.

To resolve this error, you should navigate to the yaourt folder in the /tmp directory. Log in as root and grant other users permissions to execute the PKGINFO file in there.
NOTE :- The files in /tmp will be deleted after restart. In case the files are not there, you should run the yaourt command again

chmod 755 PKGINFO

Once this has been done, you should exit from root and from the very directory where PKGINFO is there run the following. (You can’t run this as superuser)

makepkg -s

The -s flag will look for dependencies and prompt you for download. So makepkg will create a .tar.xz file and execute it as well. Now you are running this as fakeroot in their terms and this is how arch developers who removed the –asroot feature expected us to run it as it may contain malware or things harmful for our system. What you will find in most forums is how to tweak things in makepkg script to make things workout. However I tried some of them before arriving at this phase, non of them seem to work. So all that is left to do is to wait until it downloads all the packages and dependencies and then you are good to go.

PS : If you readers have any questions related to any of this please post it in the comments section. I am willing to help.