Skip to main content
166 votes

zipimport.ZipImportError: can't decompress data; zlib not available

Ubuntu 16.10+ and Python 3.7 dev sudo apt-get install zlib1g-dev Note: I only put this here because it was the top search result for the error, but this resolved my issue. Update: also the case for ...
jmunsch's user avatar
  • 4,346
83 votes

Listing packages in Yum that depend on another installed package

Answer repoquery -q --installed --whatrequires sqlite Explanations There is another command, rpm -q --whatrequires sqlite, but it doesn't really work since it only reports dependencies on package ...
Elouan Keryell-Even's user avatar
73 votes
Accepted

Can I restart systemd without rebooting?

To restart the daemon, run systemctl daemon-reexec This is documented in the systemctl manpage: Reexecute the systemd manager. This will serialize the manager state, reexecute the process ...
Stephen Kitt's user avatar
55 votes

zipimport.ZipImportError: can't decompress data; zlib not available

The solution is : # yum install zlib-devel
Knud Larsen's user avatar
  • 2,114
37 votes

Since CentOS 8 will reach EOL in 2021, what would be a good alternative to CentOS 8 for learning and practicing Red Hat?

If you want to practice RHEL, you might as well use RHEL, which is now available for no-cost production use, in a personal capacity, for small workloads of up to 16 nodes or instances (in addition to ...
Stephen Kitt's user avatar
31 votes

How to find path where jdk installed?

On RHEL7, you can use locate: locate openjdk or find: find / -iname "*openjdk-*" and it led me to the /usr/lib/jvm/ directory which contained the directories: java-1.8.0-openjdk-1.8.0.161-...
r17n's user avatar
  • 411
31 votes

Nslookup: command not found error on RHEL/CentOS 7

For those using DEBIAN, the package to use is dnsutils and the installation process should be, initiated with: sudo apt-get install dnsutils -y According to other users it is the same for Ubuntu
f4d0's user avatar
  • 411
31 votes
Accepted

What happens when a Red Hat Developer Subscription expires?

When your current subscription expires, you’ll be able to renew it at no cost, as long as you accept the terms and conditions again.
Stephen Kitt's user avatar
30 votes

systemctl status shows vendor preset: disabled

If you see a Vendor preset: Disabled, it means when the service first installs it will be disabled on start up and will have to be manually started. If you want the service to start up automatically ...
thebtm's user avatar
  • 1,395
29 votes
Accepted

What is the difference between "dnf history rollback" and "dnf history undo"?

undo only undoes that specific transaction, while rollback undoes everything between that transaction and the current state of the system. Example: you install htop, then later install ncdu and ...
Mio Rin's user avatar
  • 3,050
28 votes

Parallelise rsync using GNU Parallel

I would strongly discourage anybody from using the accepted answer, a better solution is to crawl the top level directory and launch a proportional number of rsync operations. I have a large zfs ...
Mikhail's user avatar
  • 379
28 votes
Accepted

How to label a newly created file with "system_u"?

A "temporary" label change is done via the chcon command: bash-4.2# touch freetds.conf.new bash-4.2# ls -lZ freetds.conf.new -rw-r--r--. root root unconfined_u:object_r:etc_t:s0 freetds.conf.new ...
Stephen Harris's user avatar
28 votes
Accepted

What is the best way to add a permanent route?

You mentioned /etc/network/interfaces, so it's a Debian system... Create a named routing table. As an example, I have used the name, "mgmt," below. echo '200 mgmt' >> /etc/iproute2/...
Christopher's user avatar
  • 15.9k
28 votes

How to detect new hard disk attached without rebooting?

As was mentioned above, you could scan all existing hosts with a one-liner: for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; ls /dev/sd* ; done and the result: $ for host ...
user3787216's user avatar
27 votes
Accepted

Why pwd does not accept long options like --physical?

bash has a built-in command pwd which is what you are using when you simply type pwd into your shell. To get the pwd as described by the manpage, you need force use of the external command. You can ...
wurtel's user avatar
  • 16.1k
26 votes
Accepted

systemctl command not working in RHEL 6

In earlier versions of RHEL use the service command as explained in the documentation here. # service service_name start Therefore, in your case: # service iptables start You can replace start ...
garethTheRed's user avatar
26 votes

How do I enable CentOS Repositories on RHEL Red Hat?

Delete this centos.repo (or change enabled=0 for all) and Create a new repository centos1.repo in /etc/yum.repos.d/ with the content: [centos] name=CentOS-7 baseurl=http://ftp.heanet.ie/pub/centos/7/...
erTugRul's user avatar
  • 516
25 votes
Accepted

How is the "load average" interpreted in "top" output? Is it the same for all distributions?

The CPU load is the length of the run queue, i.e. the length of the queue of processes waiting to be run. The uptime command may be used to see the average length of the run queue over the last ...
Kusalananda's user avatar
  • 335k
23 votes

'ss' command for checking sockets not found

sudo yum install iproute2 #RHEL sudo apt install iproute2 #Ubuntu
Jitendra Sharma's user avatar
23 votes

How to shrink a XFS filesystem?

Currently [2019] XFS Filesystems can't be shrunk. http://xfs.org/index.php/Shrinking_Support This is what is said on RH website: It is currently not possible to reduce the size of a partition or ...
cbiddey's user avatar
  • 339
22 votes

Parallelise rsync using GNU Parallel

I personally use this simple one: \ls -1 | parallel rsync -a {} /destination/directory/ Which only is useful when you have more than a few non-near-empty directories, else you'll end up having almost ...
Julien Palard's user avatar
22 votes
Accepted

What's the best way to edit a file with a bash script?

your_date='your desired date' sed -i "s/^Current date.*/Current date ${your_date}/" /path/to/file That's the easiest way. This assumes that all lines that contains a date to replace also are the only ...
Lizardx's user avatar
  • 3,058
21 votes

why should I use tar.xz instead of tar.gz? xz is a lossless data compression program and file format

gzip and xz uses two different algorithms, and therefore they perform differently, both in terms of what level of compression they achieve and in terms of the amount of resources they consume while ...
Kusalananda's user avatar
  • 335k
21 votes

NFS mount: Device or resource busy

These files are NFS placeholders: /home/johndoe/qwerty/.nfs000000000471494300000944 Some background In a typical UNIX filesystem, a file that is currently in use and open can be deleted but its ...
Chris Davies's user avatar
21 votes

How to detect new hard disk attached without rebooting?

This worked for me to refresh all devices: (As an easier to run command) echo "- - -" | tee /sys/class/scsi_host/host*/scan The three dashes act as wildcards to rescan everything: channel, ...
jak0lantash's user avatar
20 votes

Unable to delete file, even when running as root

I had a similar problem but had tried both permissions and chattr previously to no avail. Root in Terminal. CD to Directory. However what worked for me was to check permissions of directory where ...
Keith Mann's user avatar
20 votes

What is the equivalent of 'update-grub' for RHEL, Fedora, and CentOS systems?

On Fedora I use: grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)" because executing with no option to readlink returns a relative path, and grub2-mkconfig gives an error: $ ls -l /etc/grub2.cfg ...
Setaa's user avatar
  • 311
20 votes

What is the equivalent of 'update-grub' for RHEL, Fedora, and CentOS systems?

In Fedora, the /etc/grub2.cfg symlink points at the BIOS version. On a UEFI system, use: $ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg In CentOS: $ sudo grub2-mkconfig -o /boot/efi/EFI/...
theJPster's user avatar
  • 301
20 votes
Accepted

LVM + Couldn't create temporary archive name

You may be able to circumvent the space requirement for this operation by disabling the metadata backup with the -A|--autobackup option: lvextend -An -L+5G /dev/mapper/vg08_root If you do this, ...
JRFerguson's user avatar
  • 14.8k

Only top scored, non community-wiki answers of a minimum length are eligible