I'm installing Arch Linux thru a USB device. I have already downloaded the files into the root directory and now I was trying to set up my timezone for the clock. I went to cd /usr/share/zoneinfo and it displayed some country options for me to choose, but when I tried to access mine (Portugal), it says that it's not a directory.

This is how I try to access it: cd /usr/share/zoneinfo/Portugal

I tried with other countries for example Canada and it works on the others, not on Portugal. What should I do? What am I doing wrong and how do I fix this?

  • 1
    what is the output of ls -l /usr/share/zoneinfo/ | grep Portugal – Hunter.S.Thompson Oct 7 '17 at 16:13
  • @Hunter.S.Thompson it says: -rw-r--r-- 2 root root 3453 Mar 24 2017 Portugal – jeyejow Oct 7 '17 at 16:17

To set the timezone to Portugal do :

timedatectl set-timezone Portugal 

This command will create an /etc/localtime symlink that points to a zoneinfo file under /usr/share/zoneinfo/.

If you want to create the symlink manually do :

ln -sf /usr/share/zoneinfo/Portugal /etc/localtime

Why cant I cd into it.

It is because it is a file.

Why is it a file?

It is a file because the time difference between each city in Portugal is not that much compared to cities in bigger countries like the U.S and/or Canada, which would have Subzones in the folder, but Portugal has no Subzones, therefore it is only a file and not a directory.

  • timedatectl set-timezone Portugal give me an error: "Failed to create bus connection: No such file or directory" – jeyejow Oct 7 '17 at 16:32
  • Try the command that manually creates the link to the file. – Hunter.S.Thompson Oct 7 '17 at 16:34

To list all available time zones, you have two options:

  1. Manually list the contents of the /usr/share/zoneinfo directory.
  2. Use the timedatectl list-timezones command. This command will give you a list of results in the Region/City format. The one you are looking for is Europe/Lisbon.

Finally you have two ways of setting up the time zone:

  1. Manually, creating a symbolic link: ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime

  2. Use the timedatectl command again: sudo timedatectl set-timezone Europe/Lisbon

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.