Can't use calibre

@archiee

Go through each comment in that post and read through the links. Trust me, you will learn a lot just by reading alone.

Using an arch-based distro is different though. It takes skill and precaution to use it well. There are certain practices that are encouraged. Most issues are caused by partial updates. There are a few links in that post that teaches how to update and maintain your system the right way. Pay special attention to that.

1 Like

I should will read it carefully.

How should I uninstall packages btw? You said pacman -Rns is not there danger of removing other packages we use with this? I have read different opinions on that , I thought maybe the best practice would be to uninstall the package itself and then periodically remove only orphaned packages I have not explicitly installed.(not sure how to get that). What do you recommend for that?

@archiee

Uninstalling packages with pacman -Rns is fine. The -n option basically instructs pacman to not create a bunch of .pacsave file every time you remove a package. The -s option instructs pacman to remove packages recursively. Meaning:

Let’s say package foo depends on foobar1, foobar2 and foobar3.

The command pacman -Rs foo will remove foo along with foobar1, foobar2, and foobar3 if and only if foobar1, foobar2, and foobar3 are not required by other packages. Pacman knows how to manage all this because it stores a database file .db file for each repo locally. These files contain all the information pacman needs in order to manage package dependencies. If you are curious, you can cd into the /var/lib/pacman/sync/ directory and verify that there are 5 .db files in that directory. If you are running endeavouros, the .db files correspond to each repo. The four official Arch repos (community.db, core.db, extra.db, multilib.db) and endeavouros’s own repo (endeavouros.db).

Each of these .db files has a timestamp that pacman will use to determine whether any updates are necessary. Every time you run pacman’s Sync operation (the -S flag) and the -y option, pacman will compare the timestamps of the databases stored on your local machine with those stored in pacman’s mirrors. If the timestamp of the .db files in the mirrors are newer than the ones stored locally, pacman will download the latest copy and replace the local database with the latest copy, while listing out all the packages that need to be updated. This is possible because pacman will compare the new database with all the packages installed on your system (found in /var/lib/pacman/local/). Only when all the required updates are installed will the local packages and the databases files be in sync.

That is why it is crucial to use pacman -Syu instead of pacman -Sy. If you do that latter without running pacman -Su subsequently, your databases are refreshed to the latest ones in the mirror, but your local packages are never updated. The local packages are out of sync with the databases.

1 Like

Thanks, How I can get rid of orphan packages , Like I uninstalled some packages with only -R and they should have dependencies left over in system, of course I don’t want to remove any packages I have installed directly and used by other packages.

To obtain a list of orphans, you can run pacman -Qdtq. To remove it, you can do this:

sudo pacman -Rns $(pacman -Qdtq)

1 Like

Is there a dry run option? sorry but the man page for it is not the best one I know of.

Not that I know of. But the command sudo pacman -Rns $(pacman -Qdtq) should not be difficult to understand if you are familiar with the linux terminal.

The $() is command substitution, so if your pacman -Qdtq returns a list of orphans like so:

package_A
package_B
package_C

The command sudo pacman -Rns $(pacman -Qdtq) is equivalent to sudo pacman -Rns package_A package_B package_C

1 Like

Yeah I understand bash (basics of it at least) and this one is very simple. I just don’t understand flags for pacman as their are do different things based on the main flag they placed after. I like to see for example how much space get freed if I run that and stuff like that.

I advise everyone to consider if they really want this option or not. It only stops .pacsave files from being created for files that are in a packages backup array and that you have modified. Most packages don’t even have anything in the backup array and the ones that do are usually important config files which are very small in size.

In other words, be sure you that you want to not create a backup of important config files that you modified.

It also has the side-effect of sometimes removing optional dependencies of other packages so be careful whenever you use -s to carefully read the package list.

Be careful to read the whole list before accepting the removal, orphaned packages are not always packages you don’t need. Also, if you use -Rns to remove orphans read the note above about optional dependencies of other packages potentially being removed.

2 Likes

Config file like i home directory or in etc folder?

How I can filter them to see if any of them is an optional dependency of another package? Is there a command for that?

The -n option will not touch anything inside the .config directory. It applies to files that are listed in the backup array of the package’s PKGBUILD and the ones (inside the /etc/) that the users have modified.

You can get a list of these files with this command: sudo pacman -Qii | awk '/^MODIFIED/ {print $2}'

1 Like

Pacman will never modify anything in your /home folder. These are system level files most of which are in /etc.

Config files in your /home directory will be preserved even if you select -n.

Pacman should tell you that when you try to remove them.

checking dependencies...
:: vlc optionally requires pcsclite: aribcam support
1 Like

I had the same error (not sure if it was caused by calibre-installer which I was using before as arch’s calibre package was outdated), I fixed it by running pip uninstall lxml first and then sudo pacman -S python-html5-parser python-html5lib python-lxml as suggested above (without pip uninstall it wouldn’t make any difference)

1 Like

my solution (in ubuntu):

  1. download newest version of libxml2 from v2.10.3
  2. install alternate version from sources ( ./configure --prefix=/usr/local/libxml2 )
  3. edit ~/.profile (add to LD_LIBRARY_PATH path to /usr/local/libxml2/lib )
  4. source ~/.profile
    profit