How to fix 'character map file `UTF-8' not found' - utf-8

I'm setting up a UBI rhel8 container. I need to execute this command:
localedef -f UTF-8 -i en_US en_US.UTF-8
which failed with:
character map file `UTF-8' not found: No such file or directory
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory

You need to install these packages
yum -y install glibc-locale-source glibc-langpack-en
and then re-run localedef command

On Debian/Ubuntu, I was able to solve this via apt install locales.

I ran into this same symptom (locale-gen can't find charmap files) after upgrading from Ubuntu 20.04 to 22.04 in WSL 1. The problem is that there is a bug in WSL 1 that prevents gunzip from running. This is a problem for locale-gen because, at least in Ubuntu 22.04, the charmap files in /usr/share/i18n/charmaps are stored in GZip *.gz format. Apparently, locale-gen depends on gunzip to unzip the charmap files, and when it can't run it, it is stuck.
The solution was
copy UTF-8.gz to the Windows filesystem
unzip it to UTF-8 with a Windows tool (such as 7-zip)
copy UTF-8 back to /usr/share/i18n/charmaps
Then locale-gen worked correctly.

Related

How do I use ImageMagick to convert webp file(s) to jpg in Linux (Ubuntu 22.04) terminal

I'm trying to convert a file with the magick command-line tool but I'm confused about what the error means and how to fix it.
I used the following code syntax:
magick <input>.webp <output>.jpg
I get this error:
magick: delegate failed `'dwebp' -pam '%i' -o '%o'' # error/delegate.c/InvokeDelegate/1911.
magick: unable to open file '/tmp/magick-PGSTH7P1-9rGkrCgVJrwRyuTCjBoRkrJ': No such file or directory # error/constitute.c/ReadImage/780.
The file I'm converting is in my current directory, and I'm not using a filename for which is already being used in the directory. I've made sure my spellings are correct, and my file types are correct as well.
There were no errors during installation either:
Testsuite summary for ImageMagick 7.1.0-40
I'm running this on a Virtual Machine (Ubuntu 22.04)
I tested this again and found I needed:
sudo apt install build-essential pkg-config webp libwebp-dev libwebp7
Then you need to follow the remainder of the instructions to build from source:
./configure
make -j 4
sudo make install
sudo ldconfig /usr/local/lib

rename command not found when running Ubuntu 20.04 on VirtualBox

I installed Ubuntu 20.04 on my VirtualBox on my Windows 10 PC.
One of the tasks I wanted to do, was rename a bunch of files with the .txt extension to a .html extension. After searching online, I found that using the rename command would work.
But when attempting to run rename, I get the following error:
Command 'rename' not found. Did you mean:
Command 'hrename' from deb hsfutils (3.2.6-14)
Try: sudo apt install < deb name>
Upon trying
sudo apt install rename
I get the following error:
Unable to locate package rename
I also tried
sudo apt update
But it did not work.
Could someone tell me what to do?
Open your terminal and paste the following command
sudo apt-get install rename
Same issue.
E: Unable to locate package rename
I ended up just downloaded the .deb file.
https://ubuntu.pkgs.org/22.04/ubuntu-universe-amd64/rename_1.30-1_all.deb.html
Make sure you have perl installed.
sudo apt install perl-base --upgrade
Just for the record, rename on Linux is NOT the same as rename on windows. Rename is a powerful tool for doing batch file renames with complex patterns in one line that would otherwise take multiple lines with bash, find, mv, and other commands.

Installing hadoop on Centos 7 but command is not working

I am trying to install cluster hadoop on centos7. But command is not responding , I manually download the hadoop from this link on windows and then copy on VMware and installing using this command but this is not working.
What if you run:
tar xvzf /home/hadoop.2.7.0.tar.gz
Also could you please run and paste results for:
du /home/hadoop.2.7.0.tar.gz
tar tvzf /home/hadoop.2.7.0.tar.gz
md5sum /home/hadoop.2.7.0.tar.gz
You can find distribution with checksums here

Install ffmpeg on centos server

while installing ffmpeg on my centos server.I get this error while running ./configure: checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
cd /usr/local/src
wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=nchc
tar -xjf ffmpeg-php-0.6.0.tbz2
phpize
./configure
make make
install
Try using ffmpeg auto installer, you need to dounload a package with required plugins, its free,
you can refer this link for demo
https://www.youtube.com/watch?v=EaaT7vj8K2s
Here you will get complete installation package
http://ffmpeginstaller.com/
It will take around 30 mins for complete installation, you just need to keep an eye on command prompt.
You can Install FFMPEG on CENTOS by just Downloading rpm package of ffmpeg from ffmpeg.org and place at a particular location in ur Centos Server.
by Configuring the binary you can easily use ffmpeg commands.
Hope this Will help you :)
I hope this helps.
If ever you're trying to install ffmpeg to CENTOS 7, you might want to try this since this is what I did since I have a unsolvable problems with my packages.
Download compressed ffmpeg and extract it to the server: https://www.johnvansickle.com/ffmpeg/ in this case I used ffmpeg-git-amd64-static.tar.xz.
Extract the xz file. cmd: tar -xf filename.tar.xz
Extract the tar file if it's still in tar file. cmd: tar -xvf filename.tar
Go to the extracted file’s directory.
You must see these files under the folder
Try the command ./ffmpeg -version
Add it to the environment variable so that you can use the ffmpeg globally. Assuming that the ffmpeg main folder is contained in usr/ffmpeg, get the original PATH value using the command: echo $PATH , copy the original path value add it with the path of the ffmpeg directory (e.g. :usr/ffmpeg) and add it to the PATH environment variable with the command: export
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/ffmpeg
You should be able to use the ffmpeg command now with cmd: ffmpeg -version
Try to convert files now example: cmd: ffmpeg -i input.webm output.mp4 and it should all work now.

Error while unzipping a file in shell script. - need PK compat. v5.1 (can do v4.6)

I'm using unzip test.zip in a Shell script. But while executing this line i get an error
Archive: test.zip
skipping: hello.pdf need PK compat. v5.1 (can do v4.6)
Even if i try to run this single command from the terminal in ubuntu it throws the same error need PK compat. v5.1 (can do v4.6)
Uninstalling and reinstalling unzip also didn't work. Alternately I had to install p7zip-full to unzip the test.zip file. How to fix this and use unzip in the shell script??
Use 7z from p7zip-full package in Debian:
$ 7z x test.zip
You can use p7zip to perform the required action.
Use brew to install it.
$ brew install p7zip
use this to unzip a file
$ 7z x file.zip
I think it is "normal" that info-zip's unzip6.0 can only work with ZIP Entries which use the 4.6 version. This describes the features needed to uncompress it. The latest addition in unzip 6.0 is bzip2, which is represented in version 4.6. The 5.1 version you get when you use the (AES) strong encryption feature.
You need to use alternative tools like the mentioned 7zip (or the commercial pkunzip) to unpack those files. When you can influence the creation process, then play around with the features you use and which not (i.e. do not ask for strong password encryption if you want to be compatible with legacy infozip tool).
And yes, this is somewhat unfortunate. And I think the unzip is ported to so many target platforms, that nobody wants to work on it anymore .)
Try installing 7z sudo apt-get install p7zip-full and then extract the file with it.
For example:
7z x datafile.zip -aoa -p$3CR37
Argument -p****** is the password.
-aoa allows extraction over any existing local files.
You need install 7z
Search the package
$ apt search p7zip
....
....
p7zip/focal,now 16.02+dfsg-7build1 amd64 [已安装]
7zr file archiver with high compression ratio
p7zip-full/focal 16.02+dfsg-7build1 amd64
7z and 7za file archivers with high compression ratio
...
You can see the p7zip-full/focal 16.02+dfsg-7build1 amd64 is the currect one
$ sudo apt install p7zip-full, now you can run 7z command,for help 7z --help
Decompress file with
7z x test.zip -p****
-p Switches doesn't have write if the file has no password

Resources